Skip to content

Commit

Permalink
feat: remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guijun13 committed Aug 4, 2022
1 parent f42f5c4 commit f63eaf1
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions apps/meteor/tests/unit/client/views/notFound/NotFoundPage.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,11 @@ describe.skip('views/notFound/NotFoundPage', () => {

expect(document.body).to.have.focus;
userEvent.tab();
expect(screen.getByRole('button', { name: 'Return_to_previous_page' })).to.have.focus;
userEvent.tab();
expect(screen.getByRole('button', { name: 'Return_to_home' })).to.have.focus;
userEvent.tab();
expect(document.body).to.have.focus;
});

context('"Return to previous page" button', () => {
context('when clicked', () => {
const listener = spy();

before(() => {
window.history.pushState('404-page', '', 'http://localhost:3000/404');
window.addEventListener('popstate', listener);
});

after(() => {
window.removeEventListener('popstate', listener);
});

it('should go back on history', async () => {
render(<NotFoundPage />);
const button = screen.getByRole('button', { name: 'Return_to_previous_page' });

userEvent.click(button);
await waitFor(() => expect(listener).to.have.been.called(), { timeout: 2000 });
expect(window.history.state).to.not.be.eq('404-page');
});
});
});

context('"Return to home" button', () => {
context('when clicked', () => {
it('should go back on history', async () => {
Expand Down

0 comments on commit f63eaf1

Please sign in to comment.