style: prettier format
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
79bbbdc4e8
commit
99617f117c
45 changed files with 229 additions and 302 deletions
|
|
@ -31,7 +31,7 @@ describe('useAutosave', () => {
|
|||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
it('debounce 30 s : pas d\'appel avant, appel après', async () => {
|
||||
it("debounce 30 s : pas d'appel avant, appel après", async () => {
|
||||
const { rerender } = renderHook(
|
||||
({ contenu }: { contenu: string }) => useAutosave('sim-1', contenu, true),
|
||||
{ initialProps: { contenu: '' } },
|
||||
|
|
@ -112,7 +112,7 @@ describe('useAutosave', () => {
|
|||
expect(mocked).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('dédoublonnage : pas de second appel si le contenu n\'a pas changé', async () => {
|
||||
it("dédoublonnage : pas de second appel si le contenu n'a pas changé", async () => {
|
||||
const { rerender } = renderHook(
|
||||
({ contenu }: { contenu: string }) => useAutosave('sim-1', contenu, true),
|
||||
{ initialProps: { contenu: '' } },
|
||||
|
|
|
|||
|
|
@ -19,11 +19,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|||
import { useSimulation } from '../useSimulation'
|
||||
import { SimulationFlowProvider } from '../../state/SimulationFlowProvider'
|
||||
import { useSimulationFlow } from '../../state/simulationFlow'
|
||||
import {
|
||||
createSimulation,
|
||||
getSimulationState,
|
||||
updateSujet,
|
||||
} from '@/entities/production/api'
|
||||
import { createSimulation, getSimulationState, updateSujet } from '@/entities/production/api'
|
||||
import { correctEe } from '@/entities/report/api'
|
||||
import type { Production } from '@/entities/production/types'
|
||||
import type { Report } from '@/entities/report/types'
|
||||
|
|
@ -134,7 +130,12 @@ describe('useSimulation — selectTask', () => {
|
|||
|
||||
it('isCreating = true pendant la mutation createSimulation', async () => {
|
||||
let resolveCreate!: (p: Production) => void
|
||||
mockCreateSimulation.mockImplementation(() => new Promise(r => { resolveCreate = r }))
|
||||
mockCreateSimulation.mockImplementation(
|
||||
() =>
|
||||
new Promise((r) => {
|
||||
resolveCreate = r
|
||||
}),
|
||||
)
|
||||
|
||||
const { result } = renderHook(() => useSimulation(), { wrapper: createWrapper() })
|
||||
|
||||
|
|
@ -154,7 +155,12 @@ describe('useSimulation — submitText', () => {
|
|||
mockCreateSimulation.mockResolvedValue(mockProduction)
|
||||
|
||||
let resolveCorrect!: (r: Report) => void
|
||||
mockCorrectEe.mockImplementation(() => new Promise(r => { resolveCorrect = r }))
|
||||
mockCorrectEe.mockImplementation(
|
||||
() =>
|
||||
new Promise((r) => {
|
||||
resolveCorrect = r
|
||||
}),
|
||||
)
|
||||
|
||||
const { result } = renderHook(
|
||||
() => {
|
||||
|
|
@ -202,8 +208,7 @@ describe('useSimulation — submitText', () => {
|
|||
})
|
||||
await waitFor(() => expect(result.current.step).toBe('task-selected'))
|
||||
|
||||
act(() => result.current.submitText('Mon texte.')
|
||||
)
|
||||
act(() => result.current.submitText('Mon texte.'))
|
||||
await waitFor(() => expect(result.current.step).toBe('task-selected'))
|
||||
expect(result.current.report).toBeNull()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue