fix: mock authClient.useSession in App.test.tsx

Pre-existing test failure from Phase 1 better-auth migration.
Dashboard calls authClient.useSession() which makes an unresolved
async call in test environment. Mock it to return null session
(isPending: false) so the unauthenticated UI renders correctly.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-03-29 19:55:11 +00:00
parent 821635c0c8
commit 28292f746e
+7 -1
View File
@@ -1,7 +1,13 @@
import { render, screen } from '@testing-library/react'
import { describe, it, expect } from 'vitest'
import { describe, it, expect, vi } from 'vitest'
import App from './App.tsx'
vi.mock('./lib/auth-client.ts', () => ({
authClient: {
useSession: () => ({ data: null, isPending: false }),
},
}))
describe('App', () => {
it('renders the dashboard on the root route', () => {
render(<App />)