Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ilee2u committed Mar 8, 2024
1 parent 27f0e55 commit 0c370ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ async function fetchLatestExamAttempt(sequenceId) {
// even if it is not 'active' (timer is not running)
const attemptUrl = new URL(`${getConfig().EXAMS_BASE_URL}/api/v1/exams/attempt/latest`);
attemptUrl.searchParams.append('content_id', sequenceId);
console.log("attemptUrl:", attemptUrl.href);
const response = await getAuthenticatedHttpClient().get(attemptUrl.href);
return response.data;
}
Expand Down
12 changes: 3 additions & 9 deletions src/data/redux.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -950,22 +950,16 @@ describe('Data layer integration tests', () => {
// Reset history so we can get url at index 0 later
axiosMock.resetHistory();

const attemptToPollURL = latestAttemptURL + '?content_id=block-v1%3Atest%2Bspecial%2Bexam%2Btype%40sequential%2Bblock%40abc123';
const attemptToPollURL = `${latestAttemptURL}?content_id=block-v1%3Atest%2Bspecial%2Bexam%2Btype%40sequential%2Bblock%40abc123`;
axiosMock.onGet(attemptToPollURL).reply(200, {
time_remaining_seconds: 1739.9,
accessibility_time_string: 'you have 29 minutes remaining',
attempt_status: ExamStatus.STARTED,
});
// ADD TEST HERE

// Make sure the thunk eventually calls the right URL
await executeThunk(thunks.pollAttempt(null, exam.content_id), store.dispatch, store.getState);
const state = store.getState();



// the api request
console.log("attemptToPollURL:", attemptToPollURL);
console.log(axiosMock.history.get);
expect(axiosMock.history.get[0].url).toEqual(attemptToPollURL);
expect(state.specialExams.activeAttempt).toMatchSnapshot();
});
Expand Down

0 comments on commit 0c370ed

Please sign in to comment.