BlueSky & more on desktop lazurite.stormlightlabs.org/
tauri rust typescript bluesky appview atproto solid
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 65 lines 2.2 kB view raw
1import { AppTestProviders } from "$/test/providers"; 2import { render, screen } from "@solidjs/testing-library"; 3import { describe, expect, it } from "vitest"; 4import { SessionEmptyState, SessionSpotlight } from "../Session"; 5 6describe("SessionEmptyState", () => { 7 it("renders empty state copy", () => { 8 render(() => <SessionEmptyState />); 9 expect(screen.getByText("No account connected yet.")).toBeInTheDocument(); 10 expect(screen.getByText("Connect your Bluesky account to start exploring.")).toBeInTheDocument(); 11 }); 12}); 13 14describe("SessionSpotlight", () => { 15 it("renders 'Your account' label", () => { 16 render(() => ( 17 <AppTestProviders session={{ activeSession: null, activeAccount: null, hasSession: false }}> 18 <SessionSpotlight /> 19 </AppTestProviders> 20 )); 21 22 expect(screen.getByText("Your account")).toBeInTheDocument(); 23 }); 24 25 it("shows Ready status when no session and not bootstrapping", () => { 26 render(() => ( 27 <AppTestProviders session={{ activeSession: null, activeAccount: null, hasSession: false }}> 28 <SessionSpotlight /> 29 </AppTestProviders> 30 )); 31 32 expect(screen.getByText("Ready")).toBeInTheDocument(); 33 }); 34 35 it("shows expired account state when reauth is needed", () => { 36 const account = { active: false, did: "did:plc:alice", handle: "alice.test", pdsUrl: "https://pds.example.com" }; 37 38 render(() => ( 39 <AppTestProviders 40 session={{ 41 accounts: [account], 42 activeAccount: null, 43 activeSession: null, 44 hasSession: false, 45 primaryAccount: account, 46 reauthNeeded: true, 47 }}> 48 <SessionSpotlight /> 49 </AppTestProviders> 50 )); 51 52 expect(screen.getByText("Expired")).toBeInTheDocument(); 53 expect(screen.getByText("alice.test")).toBeInTheDocument(); 54 expect(screen.getByText("Stored account")).toBeInTheDocument(); 55 }); 56 57 it("shows Reconnecting status when bootstrapping", () => { 58 render(() => ( 59 <AppTestProviders session={{ activeSession: null, activeAccount: null, bootstrapping: true, hasSession: false }}> 60 <SessionSpotlight /> 61 </AppTestProviders> 62 )); 63 expect(screen.getByText("Reconnecting")).toBeInTheDocument(); 64 }); 65});