mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Adding test to EditorQuiz
This commit is contained in:
parent
36d0755105
commit
9b8b0ad0ec
2 changed files with 22 additions and 0 deletions
|
|
@ -60,3 +60,21 @@ describe('QuizForm Component', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('template-select is present', async () => {
|
||||||
|
render(
|
||||||
|
<MemoryRouter initialEntries={['/teacher/editor-quiz']}>
|
||||||
|
<QuizForm />
|
||||||
|
</MemoryRouter>
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(screen.queryByText('Modèles de questions')).toBeInTheDocument();
|
||||||
|
const templateButton = screen.getByTestId('template-select');
|
||||||
|
fireEvent.mouseDown(templateButton);
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
|
const vraiFauxTemplate = screen.queryAllByText(/Vrai\/Faux/i);
|
||||||
|
expect(vraiFauxTemplate.length).toBeGreaterThan(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,10 @@ const QuizForm: React.FC = () => {
|
||||||
displayEmpty
|
displayEmpty
|
||||||
onChange={(e) => handleSelectChange(e.target.value, templates.find(t => t.value === e.target.value)?.label || '')}
|
onChange={(e) => handleSelectChange(e.target.value, templates.find(t => t.value === e.target.value)?.label || '')}
|
||||||
style={{ width: '210px' }}
|
style={{ width: '210px' }}
|
||||||
|
inputProps={{
|
||||||
|
'data-testid': 'template-select'
|
||||||
|
}}
|
||||||
|
|
||||||
>
|
>
|
||||||
<MenuItem value="" disabled>Modèles de questions</MenuItem>
|
<MenuItem value="" disabled>Modèles de questions</MenuItem>
|
||||||
{templates.map((template, index) => (
|
{templates.map((template, index) => (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue