Skip to content

Commit

Permalink
test: update index snap
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacharis278 committed Jul 18, 2023
1 parent 70e23f2 commit dcb2a6a
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 23 deletions.
132 changes: 120 additions & 12 deletions src/pages/ExamsPage/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,66 @@ Object {
<div
class="container-fluid"
>
<div>
<ul>
<li>
exam1
</li>
</ul>
<div
class="container-fluid"
id="exam-selector"
>
<div
data-testid="exam_selection"
>
<div
class="pgn__menu-select"
>
<button
aria-expanded="false"
aria-haspopup="true"
class="btn btn-outline-primary"
type="button"
>
Select an exam
<span
class="pgn__icon btn-icon-after"
>
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"
fill="currentColor"
/>
</svg>
</span>
</button>
<div
class="pgn__menu-select-popup"
>
<div
style="position: absolute; left: 0px; top: 0px; z-index: 2000;"
>
<div
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="-1"
/>
<div
data-focus-lock-disabled="disabled"
/>
<div
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="-1"
/>
</div>
</div>
</div>
</div>
</div>
<div>
<nav
Expand Down Expand Up @@ -434,12 +488,66 @@ Object {
<div
class="container-fluid"
>
<div>
<ul>
<li>
exam1
</li>
</ul>
<div
class="container-fluid"
id="exam-selector"
>
<div
data-testid="exam_selection"
>
<div
class="pgn__menu-select"
>
<button
aria-expanded="false"
aria-haspopup="true"
class="btn btn-outline-primary"
type="button"
>
Select an exam
<span
class="pgn__icon btn-icon-after"
>
<svg
aria-hidden="true"
fill="none"
focusable="false"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"
fill="currentColor"
/>
</svg>
</span>
</button>
<div
class="pgn__menu-select-popup"
>
<div
style="position: absolute; left: 0px; top: 0px; z-index: 2000;"
>
<div
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="-1"
/>
<div
data-focus-lock-disabled="disabled"
/>
<div
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="-1"
/>
</div>
</div>
</div>
</div>
</div>
<div>
<nav
Expand Down
12 changes: 1 addition & 11 deletions src/pages/ExamsPage/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('ExamsPage', () => {
{ id: 1, name: 'exam1' },
],
currentExam: { id: 1, name: 'exam1' },
isLoading: false,
setCurrentExam: jest.fn(),
};
const defaultAttemptsData = {
attemptsList: [{
Expand All @@ -46,16 +46,6 @@ describe('ExamsPage', () => {
expect(render(<ExamsPage courseId="test_course" />)).toMatchSnapshot();
});
});
describe('loading message', () => {
it('should render while fetching data', () => {
hooks.useExamsData.mockReturnValue({
...defaultExamsData,
isLoading: true,
});
render(<ExamsPage courseId="test_course" />);
expect(screen.getByText('Loading...')).toBeInTheDocument();
});
});
describe('tab navigation', () => {
beforeEach(() => {
render(<ExamsPage courseId="test_course" />);
Expand Down

0 comments on commit dcb2a6a

Please sign in to comment.