fix(lint): 4 erreurs ESLint corrigées — split SimulationFlowProvider, hook conditionnel, ref render, setState effect

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann_Kitio 2026-04-23 03:05:14 +03:00
parent de69b3ff16
commit 79bbbdc4e8
10 changed files with 82 additions and 50 deletions

View file

@ -5,7 +5,7 @@
* Le hook `usePatterns` est mocké pour isoler la présentation.
*/
import { describe, it, expect, vi, afterEach } from 'vitest'
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
import { render, screen, cleanup } from '@testing-library/react'
import { MemoryRouter } from 'react-router-dom'
@ -16,6 +16,16 @@ vi.mock('@/features/progression/hooks/usePatterns', () => ({
import { usePatterns } from '@/features/progression/hooks/usePatterns'
import { MonProfilPreparation } from '../MonProfilPreparation'
beforeEach(() => {
// Mock par défaut — usePatterns est appelé inconditionnellement depuis le
// composant (Règle des hooks). Les tests Premium surchargent ce mock.
vi.mocked(usePatterns).mockReturnValue({
data: undefined,
isLoading: false,
isError: false,
} as unknown as ReturnType<typeof usePatterns>)
})
afterEach(cleanup)
function renderWithRouter(ui: React.ReactNode) {