import { describe, it, expect } from 'vitest' import { render, screen } from '@testing-library/react' import CourseBuildStepper from '../../../src/renderer/src/components/CourseBuildStepper' import type { CourseBuildState } from '../../../src/shared/courseBuild' const STATE: CourseBuildState = { subject: 'algebre', steps: [ { key: 'recherche', label: 'Recherche approfondie', status: 'done', detail: '5 source(s)' }, { key: 'plan', label: 'Objectif et plan de modules', status: 'active' }, { key: 'redaction', label: 'Redaction des modules', status: 'pending' } ] } describe('', () => { it('should display the subject name', () => { render() expect(screen.getByText(/algebre/)).toBeInTheDocument() }) it('should display every step label', () => { render() expect(screen.getByText('Recherche approfondie')).toBeInTheDocument() expect(screen.getByText('Objectif et plan de modules')).toBeInTheDocument() expect(screen.getByText('Redaction des modules')).toBeInTheDocument() }) it('should display the detail text only for steps that have one', () => { render() expect(screen.getByText('5 source(s)')).toBeInTheDocument() }) })