A personal media tracker built on the AT Protocol opnshelf.xyz
0
fork

Configure Feed

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

Update tests for expanded user DTO

- Use the full `UserDto` shape in header and home page tests
- Fix root unmount handling in test cleanup

+13 -7
+7 -6
apps/web/src/components/Header.test.tsx
··· 1 1 // @vitest-environment jsdom 2 2 3 + import type { UserDto } from "@opnshelf/api"; 3 4 import { act } from "react"; 4 5 import { createRoot, type Root } from "react-dom/client"; 5 6 import { afterEach, describe, expect, it, vi } from "vitest"; ··· 80 81 vi.clearAllMocks(); 81 82 82 83 if (root) { 84 + const mountedRoot = root; 83 85 act(() => { 84 - root.unmount(); 86 + mountedRoot.unmount(); 85 87 }); 86 88 } 87 89 ··· 91 93 document.body.innerHTML = ""; 92 94 }); 93 95 94 - function renderHeader(user: { 95 - did: string; 96 - handle: string; 97 - displayName: string; 98 - }) { 96 + function renderHeader(user: UserDto) { 99 97 mockUseQueryClient.mockReturnValue({ name: "query-client" }); 100 98 mockPublishSignedOutAuthState.mockResolvedValue(undefined); 101 99 mockUseMutation.mockImplementation( ··· 125 123 did: "did:plc:alice", 126 124 handle: "alice", 127 125 displayName: "Alice", 126 + avatar: null, 127 + onboardingCompletedAt: null, 128 + needsOnboarding: false, 128 129 }); 129 130 130 131 const signOutButton = Array.from(document.querySelectorAll("button")).find(
+6 -1
apps/web/src/routes/-index.test.tsx
··· 43 43 vi.clearAllMocks(); 44 44 45 45 if (root) { 46 + const mountedRoot = root; 46 47 act(() => { 47 - root.unmount(); 48 + mountedRoot.unmount(); 48 49 }); 49 50 } 50 51 ··· 94 95 data: { 95 96 did: "did:plc:alice", 96 97 handle: "alice", 98 + displayName: "Alice", 99 + avatar: null, 100 + onboardingCompletedAt: null, 101 + needsOnboarding: false, 97 102 }, 98 103 isLoading: false, 99 104 });