Skip to content

Commit

Permalink
[#19] Add test for PrivateRoutes but infinite redirect loop if no user
Browse files Browse the repository at this point in the history
  • Loading branch information
liamstevens111 committed Mar 22, 2023
1 parent fa56b78 commit 5c2d2c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/PrivateRoute/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable camelcase */
import { MemoryRouter } from 'react-router-dom';

import { render, screen } from '@testing-library/react';
import { render, screen, waitForElementToBeRemoved } from '@testing-library/react';

import PrivateRoute from '.';
import { setItem, clearItem } from '../../helpers/localStorage';
Expand Down Expand Up @@ -41,7 +41,5 @@ describe('PrivateRoute', () => {
render(<PrivateRoute />, { wrapper: MemoryRouter });

expect(screen.getByTestId('loading')).toHaveTextContent('Loading');

// expect(screen.getByTestId('loading')).not.toBeVisible();
});
});

0 comments on commit 5c2d2c3

Please sign in to comment.