Skip to content

Commit

Permalink
feat: tests
Browse files Browse the repository at this point in the history
* Getting rid of the 404 test with the old error message
* replacing with a no return test with the new loading message

FIXES: APER-2190
  • Loading branch information
deborahgu committed Sep 29, 2023
1 parent c567bb5 commit 8fb08a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/ProgramRecord/test/ProgramRecord.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ describe('program-record', () => {
expect(await screen.findByText('An error occurred attempting to retrieve your program records. Please try again later.')).toBeTruthy();
});

it('renders not found message on unsuccessful request', async () => {
it('renders loading message on delay', async () => {
const axiosMock = new MockAdapter(getAuthenticatedHttpClient());
axiosMock
.onGet(`${getConfig().CREDENTIALS_BASE_URL}/records/api/v1/program_records/test-id/?is_public=false`)
.reply(404, {});
.onGet(`${getConfig().CREDENTIALS_BASE_URL}/records/api/v1/program_records/test-id/?is_public=false`);
render(<ProgramRecord isPublic={false} />);
expect(await screen.findByText('The page you\'re looking for is unavailable or there\'s an error in the URL. Please check the URL and try again.')).toBeTruthy();
expect(await screen.findByText('Loading...')).toBeTruthy();
});
});

0 comments on commit 8fb08a9

Please sign in to comment.