mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
parent
c13a38af70
commit
5edd556688
2 changed files with 13 additions and 13 deletions
|
|
@ -227,7 +227,7 @@ test('calls showSelectedQuestion when a table cell is clicked', () => {
|
||||||
expect(mockShowSelectedQuestion).toHaveBeenCalled();
|
expect(mockShowSelectedQuestion).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skip('toggles the visibility of content when the arrow button is clicked', () => {
|
test('toggles the visibility of content when the arrow button is clicked', () => {
|
||||||
render(<LiveResults
|
render(<LiveResults
|
||||||
socket={null}
|
socket={null}
|
||||||
questions={mockQuestions}
|
questions={mockQuestions}
|
||||||
|
|
@ -235,19 +235,16 @@ test.skip('toggles the visibility of content when the arrow button is clicked',
|
||||||
quizMode="teacher"
|
quizMode="teacher"
|
||||||
students={mockStudents}
|
students={mockStudents}
|
||||||
/>);
|
/>);
|
||||||
const toggleSwitch = screen.getByTestId("liveResults-visibility-switch");
|
const toggleSwitch = screen.getByTestId("liveResults-switch");
|
||||||
fireEvent.click(toggleSwitch);
|
|
||||||
expect(toggleSwitch).toBeInTheDocument();
|
expect(toggleSwitch).toBeInTheDocument();
|
||||||
|
|
||||||
expect(toggleSwitch).toBeChecked();
|
|
||||||
expect(screen.queryByText('Afficher les noms')).toBeInTheDocument();
|
expect(screen.queryByText('Afficher les noms')).toBeInTheDocument();
|
||||||
expect(screen.queryByText('Afficher les réponses')).toBeInTheDocument();
|
expect(screen.queryByText('Afficher les réponses')).toBeInTheDocument();
|
||||||
expect(screen.queryByTestId('table-container')).toBeInTheDocument();
|
expect(screen.queryByTestId('table-container')).toBeInTheDocument();
|
||||||
|
|
||||||
|
|
||||||
fireEvent.click(toggleSwitch);
|
fireEvent.click(toggleSwitch);
|
||||||
|
screen.debug();
|
||||||
|
|
||||||
expect(toggleSwitch).not.toBeChecked();
|
|
||||||
expect(screen.queryByText('Afficher les noms')).not.toBeInTheDocument();
|
expect(screen.queryByText('Afficher les noms')).not.toBeInTheDocument();
|
||||||
expect(screen.queryByText('Afficher les réponses')).not.toBeInTheDocument();
|
expect(screen.queryByText('Afficher les réponses')).not.toBeInTheDocument();
|
||||||
expect(screen.queryByTestId('table-container')).not.toBeInTheDocument();
|
expect(screen.queryByTestId('table-container')).not.toBeInTheDocument();
|
||||||
|
|
|
||||||
|
|
@ -36,13 +36,16 @@ const LiveResults: React.FC<LiveResultsProps> = ({ questions, showSelectedQuesti
|
||||||
<div>
|
<div>
|
||||||
<div className="action-bar">
|
<div className="action-bar">
|
||||||
<div>
|
<div>
|
||||||
<Switch
|
<FormControlLabel
|
||||||
data-testid="liveResults-visibility-switch"
|
label={<div className="text-sm">Résultats du quiz</div>}
|
||||||
checked={isExpanded}
|
control={
|
||||||
onChange={() => toggleExpand()}
|
<Switch
|
||||||
inputProps={{ 'aria-label': 'toggle visibility' }}
|
data-testid="liveResults-switch"
|
||||||
/>
|
checked={isExpanded}
|
||||||
<span>Résultats du quiz</span>
|
onChange={() => toggleExpand()}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{isExpanded && (
|
{isExpanded && (
|
||||||
<FormGroup row className='form-group'>
|
<FormGroup row className='form-group'>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue