feat(ui): vue jeu branchée avec accueil et navigation (P3, F-01 à F-04, F-10)

This commit is contained in:
devcodetools committed 2026-09-22 08:38:59 +02:00
1 parent 0233be7fff
commit 61eef32c74
9 files changed
+136 -12

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import { render, screen } from '@testing-library/react'
import { describe, expect, it, vi } from 'vitest'
import PlayPage from './page'
vi.mock('@/lib/api-client', () => ({
ApiClientError: class extends Error {
status = 0
},
cardsApi: { themes: vi.fn(), random: vi.fn() },
}))
import { cardsApi } from '@/lib/api-client'
describe('PlayPage', () => {
it('monte le jeu avec le sélecteur de thème et le tirage (F-01 à F-04, F-10)', async () => {
vi.mocked(cardsApi.themes).mockResolvedValue(['git'])
render(<PlayPage />)
expect(screen.getByRole('button', { name: 'Tirer une carte' })).toBeInTheDocument()
expect(screen.getByLabelText('Th\u00e8me')).toBeInTheDocument()
await screen.findByRole('option', { name: 'git' })
})
})