diff --git a/__tests__/actions/__snapshots__/challenge.js.snap b/__tests__/actions/__snapshots__/challenge.js.snap index a996a82a..709efa4e 100644 --- a/__tests__/actions/__snapshots__/challenge.js.snap +++ b/__tests__/actions/__snapshots__/challenge.js.snap @@ -2,7 +2,7 @@ exports[`challenge.fetchChallengeInit 1`] = ` Object { - "payload": "12345", + "payload": "123456789", "type": "CHALLENGE/GET_DETAILS_INIT", } `; @@ -16,7 +16,7 @@ Object { exports[`challenge.fetchSubmissionsInit 1`] = ` Object { - "payload": "12345", + "payload": "123456789", "type": "CHALLENGE/GET_SUBMISSIONS_INIT", } `; diff --git a/__tests__/actions/challenge.js b/__tests__/actions/challenge.js index 2547692c..56ccc005 100644 --- a/__tests__/actions/challenge.js +++ b/__tests__/actions/challenge.js @@ -3,20 +3,20 @@ import { actions } from '../../src'; jest.mock('../../src/services/challenges'); test('challenge.fetchChallengeInit', () => { - expect(actions.challenge.getDetailsInit(12345)).toMatchSnapshot(); + expect(actions.challenge.getDetailsInit(123456789)).toMatchSnapshot(); }); test('challenge.fetchSubmissionsInit', () => { - expect(actions.challenge.getSubmissionsInit(12345)).toMatchSnapshot(); + expect(actions.challenge.getSubmissionsInit(123456789)).toMatchSnapshot(); }); test('challenge.getDetailsDone', () => { - expect(actions.challenge.getDetailsDone(12345)).toMatchSnapshot(); + expect(actions.challenge.getDetailsDone(123456789)).toMatchSnapshot(); }); test('challenge.fetchSubmissionsDone', () => { - expect(actions.challenge.getSubmissionsDone(12345, {})).toMatchSnapshot(); + expect(actions.challenge.getSubmissionsDone(123456789, {})).toMatchSnapshot(); }); test('challenge.getActiveChallengesCountInit', () => { diff --git a/__tests__/reducers/__snapshots__/challenge.js.snap b/__tests__/reducers/__snapshots__/challenge.js.snap index be090f1d..009e5691 100644 --- a/__tests__/reducers/__snapshots__/challenge.js.snap +++ b/__tests__/reducers/__snapshots__/challenge.js.snap @@ -25,7 +25,7 @@ exports[`Default reducer Handles CHALLENGE/GET_DETAILS_DONE as expected 1`] = ` Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": false, @@ -50,7 +50,7 @@ exports[`Default reducer Handles CHALLENGE/GET_DETAILS_DONE with error as expect Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -77,7 +77,7 @@ Object { "details": null, "fetchChallengeFailure": false, "loadingCheckpoints": false, - "loadingDetailsForChallengeId": "12345", + "loadingDetailsForChallengeId": "123456789", "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", @@ -97,7 +97,7 @@ exports[`Default reducer Handles deleteSubmissionDone as expected 1`] = ` Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -109,7 +109,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [], }, "mySubmissionsManagement": Object { @@ -128,7 +128,7 @@ exports[`Default reducer Handles fetchSubmissionsDone as expected 1`] = ` Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -140,7 +140,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -161,7 +161,7 @@ exports[`Default reducer Handles fetchSubmissionsDoneError as expected 1`] = ` Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -192,7 +192,7 @@ exports[`Default reducer Handles fetchSubmissionsInit as expected 1`] = ` Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -201,7 +201,7 @@ Object { "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", - "loadingSubmissionsForChallengeId": "12345", + "loadingSubmissionsForChallengeId": "123456789", "mmSubmissions": Array [], "mySubmissions": Object { "challengeId": "", @@ -222,7 +222,7 @@ Object { "activeChallengesCount": 5, "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -253,7 +253,7 @@ exports[`Factory with server-side rendering Creates expected intial state 1`] = Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": false, @@ -265,7 +265,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -286,7 +286,7 @@ exports[`Factory with server-side rendering Handles CHALLENGE/GET_DETAILS_DONE a Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": false, @@ -298,7 +298,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -319,7 +319,7 @@ exports[`Factory with server-side rendering Handles CHALLENGE/GET_DETAILS_DONE w Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -331,7 +331,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -352,19 +352,19 @@ exports[`Factory with server-side rendering Handles CHALLENGE/GET_DETAILS_INIT a Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": false, "loadingCheckpoints": false, - "loadingDetailsForChallengeId": "12345", + "loadingDetailsForChallengeId": "123456789", "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -385,7 +385,7 @@ exports[`Factory with server-side rendering Handles deleteSubmissionDone as expe Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -397,7 +397,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [], }, "mySubmissionsManagement": Object { @@ -416,7 +416,7 @@ exports[`Factory with server-side rendering Handles fetchSubmissionsDone as expe Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -428,7 +428,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -449,7 +449,7 @@ exports[`Factory with server-side rendering Handles fetchSubmissionsDoneError as Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -480,7 +480,7 @@ exports[`Factory with server-side rendering Handles fetchSubmissionsInit as expe Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -489,7 +489,7 @@ Object { "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", - "loadingSubmissionsForChallengeId": "12345", + "loadingSubmissionsForChallengeId": "123456789", "mmSubmissions": Array [], "mySubmissions": Object { "challengeId": "", @@ -510,7 +510,7 @@ Object { "activeChallengesCount": 5, "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -562,7 +562,7 @@ exports[`Factory without http request Handles CHALLENGE/GET_DETAILS_DONE as expe Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": false, @@ -587,7 +587,7 @@ exports[`Factory without http request Handles CHALLENGE/GET_DETAILS_DONE with er Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -614,7 +614,7 @@ Object { "details": null, "fetchChallengeFailure": false, "loadingCheckpoints": false, - "loadingDetailsForChallengeId": "12345", + "loadingDetailsForChallengeId": "123456789", "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", @@ -634,7 +634,7 @@ exports[`Factory without http request Handles deleteSubmissionDone as expected 1 Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -646,7 +646,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [], }, "mySubmissionsManagement": Object { @@ -665,7 +665,7 @@ exports[`Factory without http request Handles fetchSubmissionsDone as expected 1 Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -677,7 +677,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -698,7 +698,7 @@ exports[`Factory without http request Handles fetchSubmissionsDoneError as expec Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -729,7 +729,7 @@ exports[`Factory without http request Handles fetchSubmissionsInit as expected 1 Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -738,7 +738,7 @@ Object { "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", - "loadingSubmissionsForChallengeId": "12345", + "loadingSubmissionsForChallengeId": "123456789", "mmSubmissions": Array [], "mySubmissions": Object { "challengeId": "", @@ -759,7 +759,7 @@ Object { "activeChallengesCount": 5, "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -811,7 +811,7 @@ exports[`Factory without server-side rendering Handles CHALLENGE/GET_DETAILS_DON Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": false, @@ -836,7 +836,7 @@ exports[`Factory without server-side rendering Handles CHALLENGE/GET_DETAILS_DON Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -863,7 +863,7 @@ Object { "details": null, "fetchChallengeFailure": false, "loadingCheckpoints": false, - "loadingDetailsForChallengeId": "12345", + "loadingDetailsForChallengeId": "123456789", "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", @@ -883,7 +883,7 @@ exports[`Factory without server-side rendering Handles deleteSubmissionDone as e Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -895,7 +895,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [], }, "mySubmissionsManagement": Object { @@ -914,7 +914,7 @@ exports[`Factory without server-side rendering Handles fetchSubmissionsDone as e Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -926,7 +926,7 @@ Object { "loadingSubmissionsForChallengeId": "", "mmSubmissions": Array [], "mySubmissions": Object { - "challengeId": "12345", + "challengeId": "123456789", "v2": Array [ Object { "submissionId": "1", @@ -947,7 +947,7 @@ exports[`Factory without server-side rendering Handles fetchSubmissionsDoneError Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -978,7 +978,7 @@ exports[`Factory without server-side rendering Handles fetchSubmissionsInit as e Object { "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", @@ -987,7 +987,7 @@ Object { "loadingMMSubmissionsForChallengeId": "", "loadingResultsForChallengeId": "", "loadingSubmissionInformationForSubmissionId": "", - "loadingSubmissionsForChallengeId": "12345", + "loadingSubmissionsForChallengeId": "123456789", "mmSubmissions": Array [], "mySubmissions": Object { "challengeId": "", @@ -1008,7 +1008,7 @@ Object { "activeChallengesCount": 5, "checkpoints": null, "details": Object { - "id": 12345, + "id": 123456789, "tag": "v3-normalized-details", }, "fetchChallengeFailure": "Unknown error", diff --git a/__tests__/reducers/challenge.js b/__tests__/reducers/challenge.js index 5177aaff..b35324c1 100644 --- a/__tests__/reducers/challenge.js +++ b/__tests__/reducers/challenge.js @@ -5,24 +5,24 @@ import { actions } from '../../src'; const mockChallengeActions = { challenge: { - getDetailsInit: mockAction('CHALLENGE/GET_DETAILS_INIT', '12345'), + getDetailsInit: mockAction('CHALLENGE/GET_DETAILS_INIT', '123456789'), getDetailsDone: mockAction('CHALLENGE/GET_DETAILS_DONE', Promise.resolve({ - id: 12345, + id: 123456789, tag: 'v3-normalized-details', })), getDetailsDoneError: mockAction( 'CHALLENGE/GET_DETAILS_DONE', - { challengeId: '12345' }, + { challengeId: '123456789' }, 'Unknown error', ), - getSubmissionsInit: mockAction('CHALLENGE/GET_SUBMISSIONS_INIT', '12345'), + getSubmissionsInit: mockAction('CHALLENGE/GET_SUBMISSIONS_INIT', '123456789'), getSubmissionsDone: mockAction( 'CHALLENGE/GET_SUBMISSIONS_DONE', - Promise.resolve({ challengeId: '12345', submissions: [{ submissionId: '1' }] }), + Promise.resolve({ challengeId: '123456789', submissions: [{ submissionId: '1' }] }), ), getSubmissionsDoneError: mockAction( 'CHALLENGE/GET_SUBMISSIONS_DONE', - { challengeId: '12345' }, + { challengeId: '123456789' }, 'Unknown error', ), getActiveChallengesCountDone: mockAction('CHALLENGE/GET_ACTIVE_CHALLENGES_COUNT_DONE', 5), @@ -64,7 +64,7 @@ function testReducer() { }); test('Handles CHALLENGE/GET_DETAILS_INIT as expected', () => { - state = reducer(state, mockChallengeActions.challenge.getDetailsInit(12345)); + state = reducer(state, mockChallengeActions.challenge.getDetailsInit(123456789)); expect(state).toMatchSnapshot(); }); @@ -139,7 +139,7 @@ describe('Factory with server-side rendering', () => { }, challenge: { challengeDetails: { - id: '12345', + id: '123456789', mySubmission: true, }, },