Skip to content

Commit 135c761

Browse files
committed
fix: add missing mocks for analytics in App tests
The App.test.tsx mock for @/hooks/useDomainEvents was missing the useDomainEvents export used by the new useAnalytics hook, causing all 12 App tests to fail in CI. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent bb320c9 commit 135c761

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/ts/components/App.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ vi.mock('@/hooks/useDomainEvents', () => ({
6868
gatewayEventCallbacks.push(cb);
6969
}),
7070
useServerStatusEvents: vi.fn(),
71+
useDomainEvents: vi.fn(() => ({ subscribe: vi.fn(() => vi.fn()) })),
72+
}));
73+
74+
vi.mock('@/lib/analytics', () => ({
75+
initAnalytics: vi.fn(),
76+
capture: vi.fn(),
77+
optOut: vi.fn(),
78+
optIn: vi.fn(),
79+
hasOptedOut: vi.fn(() => false),
7180
}));
7281

7382
function fireGatewayEvent(payload: GatewayPayload) {

0 commit comments

Comments
 (0)