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 ca58708 commit d267ff2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 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 @@ -936,22 +936,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
1 change: 0 additions & 1 deletion src/data/thunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export function pollAttempt(url) {
// test w/ timed exam
const { exam } = getState().specialExams;
const data = await pollExamAttempt(url, exam.content_id);
console.log(data.time_remaining_seconds);
const updatedAttempt = {
...currentAttempt,
time_remaining_seconds: data.time_remaining_seconds,
Expand Down

0 comments on commit d267ff2

Please sign in to comment.