mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
[BUG] Dans un quiz au rythme de l'étudiant, l'enseignant ne peut plus masquer les questions
Fixes #295
This commit is contained in:
parent
206895ebb5
commit
66f8510f9a
3 changed files with 8 additions and 7 deletions
|
|
@ -344,11 +344,10 @@ describe('ManageRoom', () => {
|
|||
const tableHeader = screen.getByText('Q1');
|
||||
fireEvent.click(tableHeader);
|
||||
|
||||
const closeButton = screen.getByRole('button', { name: /✖/i });
|
||||
expect(closeButton).toBeInTheDocument();
|
||||
const questionVisibilitySwitch = screen.getByTestId('question-visibility-switch'); // Get the specific switch
|
||||
expect(screen.getByText(/Question 1\//i)).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(closeButton);
|
||||
fireEvent.click(questionVisibilitySwitch);
|
||||
|
||||
expect(screen.queryByRole('button', { name: /✖/i })).not.toBeInTheDocument();
|
||||
expect(screen.queryByText(/Question 1\//i)).not.toBeInTheDocument();
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@ const ManageRoom: React.FC = () => {
|
|||
return;
|
||||
}
|
||||
setQuizQuestions(quizQuestions);
|
||||
setCurrentQuestion(quizQuestions[0]);
|
||||
webSocketService.launchStudentModeQuiz(formattedRoomName, quizQuestions);
|
||||
};
|
||||
|
||||
|
|
@ -480,7 +481,8 @@ const ManageRoom: React.FC = () => {
|
|||
label={<div className="text-sm">Afficher les questions</div>}
|
||||
control={
|
||||
<Switch
|
||||
value={isQuestionShown}
|
||||
data-testid="question-visibility-switch" // Add a unique test ID
|
||||
checked={isQuestionShown}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
setIsQuestionShown(e.target.checked)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
.close-button-wrapper{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: flex-start;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue