Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit edd0eaf

Browse files
committedJun 3, 2020
fix tests
1 parent 2b8c31e commit edd0eaf

File tree

4 files changed

+64
-64
lines changed

4 files changed

+64
-64
lines changed
 

‎__tests__/actions/__snapshots__/challenge.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`challenge.fetchChallengeInit 1`] = `
44
Object {
5-
"payload": "12345",
5+
"payload": "123456789",
66
"type": "CHALLENGE/GET_DETAILS_INIT",
77
}
88
`;
@@ -16,7 +16,7 @@ Object {
1616

1717
exports[`challenge.fetchSubmissionsInit 1`] = `
1818
Object {
19-
"payload": "12345",
19+
"payload": "123456789",
2020
"type": "CHALLENGE/GET_SUBMISSIONS_INIT",
2121
}
2222
`;

‎__tests__/actions/challenge.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ import { actions } from '../../src';
33
jest.mock('../../src/services/challenges');
44

55
test('challenge.fetchChallengeInit', () => {
6-
expect(actions.challenge.getDetailsInit(12345)).toMatchSnapshot();
6+
expect(actions.challenge.getDetailsInit(123456789)).toMatchSnapshot();
77
});
88

99
test('challenge.fetchSubmissionsInit', () => {
10-
expect(actions.challenge.getSubmissionsInit(12345)).toMatchSnapshot();
10+
expect(actions.challenge.getSubmissionsInit(123456789)).toMatchSnapshot();
1111
});
1212

1313

1414
test('challenge.getDetailsDone', () => {
15-
expect(actions.challenge.getDetailsDone(12345)).toMatchSnapshot();
15+
expect(actions.challenge.getDetailsDone(123456789)).toMatchSnapshot();
1616
});
1717

1818
test('challenge.fetchSubmissionsDone', () => {
19-
expect(actions.challenge.getSubmissionsDone(12345, {})).toMatchSnapshot();
19+
expect(actions.challenge.getSubmissionsDone(123456789, {})).toMatchSnapshot();
2020
});
2121

2222
test('challenge.getActiveChallengesCountInit', () => {

‎__tests__/reducers/__snapshots__/challenge.js.snap

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exports[`Default reducer Handles CHALLENGE/GET_DETAILS_DONE as expected 1`] = `
2525
Object {
2626
"checkpoints": null,
2727
"details": Object {
28-
"id": 12345,
28+
"id": 123456789,
2929
"tag": "v3-normalized-details",
3030
},
3131
"fetchChallengeFailure": false,
@@ -50,7 +50,7 @@ exports[`Default reducer Handles CHALLENGE/GET_DETAILS_DONE with error as expect
5050
Object {
5151
"checkpoints": null,
5252
"details": Object {
53-
"id": 12345,
53+
"id": 123456789,
5454
"tag": "v3-normalized-details",
5555
},
5656
"fetchChallengeFailure": "Unknown error",
@@ -77,7 +77,7 @@ Object {
7777
"details": null,
7878
"fetchChallengeFailure": false,
7979
"loadingCheckpoints": false,
80-
"loadingDetailsForChallengeId": "12345",
80+
"loadingDetailsForChallengeId": "123456789",
8181
"loadingMMSubmissionsForChallengeId": "",
8282
"loadingResultsForChallengeId": "",
8383
"loadingSubmissionInformationForSubmissionId": "",
@@ -97,7 +97,7 @@ exports[`Default reducer Handles deleteSubmissionDone as expected 1`] = `
9797
Object {
9898
"checkpoints": null,
9999
"details": Object {
100-
"id": 12345,
100+
"id": 123456789,
101101
"tag": "v3-normalized-details",
102102
},
103103
"fetchChallengeFailure": "Unknown error",
@@ -109,7 +109,7 @@ Object {
109109
"loadingSubmissionsForChallengeId": "",
110110
"mmSubmissions": Array [],
111111
"mySubmissions": Object {
112-
"challengeId": "12345",
112+
"challengeId": "123456789",
113113
"v2": Array [],
114114
},
115115
"mySubmissionsManagement": Object {
@@ -128,7 +128,7 @@ exports[`Default reducer Handles fetchSubmissionsDone as expected 1`] = `
128128
Object {
129129
"checkpoints": null,
130130
"details": Object {
131-
"id": 12345,
131+
"id": 123456789,
132132
"tag": "v3-normalized-details",
133133
},
134134
"fetchChallengeFailure": "Unknown error",
@@ -140,7 +140,7 @@ Object {
140140
"loadingSubmissionsForChallengeId": "",
141141
"mmSubmissions": Array [],
142142
"mySubmissions": Object {
143-
"challengeId": "12345",
143+
"challengeId": "123456789",
144144
"v2": Array [
145145
Object {
146146
"submissionId": "1",
@@ -161,7 +161,7 @@ exports[`Default reducer Handles fetchSubmissionsDoneError as expected 1`] = `
161161
Object {
162162
"checkpoints": null,
163163
"details": Object {
164-
"id": 12345,
164+
"id": 123456789,
165165
"tag": "v3-normalized-details",
166166
},
167167
"fetchChallengeFailure": "Unknown error",
@@ -192,7 +192,7 @@ exports[`Default reducer Handles fetchSubmissionsInit as expected 1`] = `
192192
Object {
193193
"checkpoints": null,
194194
"details": Object {
195-
"id": 12345,
195+
"id": 123456789,
196196
"tag": "v3-normalized-details",
197197
},
198198
"fetchChallengeFailure": "Unknown error",
@@ -201,7 +201,7 @@ Object {
201201
"loadingMMSubmissionsForChallengeId": "",
202202
"loadingResultsForChallengeId": "",
203203
"loadingSubmissionInformationForSubmissionId": "",
204-
"loadingSubmissionsForChallengeId": "12345",
204+
"loadingSubmissionsForChallengeId": "123456789",
205205
"mmSubmissions": Array [],
206206
"mySubmissions": Object {
207207
"challengeId": "",
@@ -222,7 +222,7 @@ Object {
222222
"activeChallengesCount": 5,
223223
"checkpoints": null,
224224
"details": Object {
225-
"id": 12345,
225+
"id": 123456789,
226226
"tag": "v3-normalized-details",
227227
},
228228
"fetchChallengeFailure": "Unknown error",
@@ -253,7 +253,7 @@ exports[`Factory with server-side rendering Creates expected intial state 1`] =
253253
Object {
254254
"checkpoints": null,
255255
"details": Object {
256-
"id": 12345,
256+
"id": 123456789,
257257
"tag": "v3-normalized-details",
258258
},
259259
"fetchChallengeFailure": false,
@@ -265,7 +265,7 @@ Object {
265265
"loadingSubmissionsForChallengeId": "",
266266
"mmSubmissions": Array [],
267267
"mySubmissions": Object {
268-
"challengeId": "12345",
268+
"challengeId": "123456789",
269269
"v2": Array [
270270
Object {
271271
"submissionId": "1",
@@ -286,7 +286,7 @@ exports[`Factory with server-side rendering Handles CHALLENGE/GET_DETAILS_DONE a
286286
Object {
287287
"checkpoints": null,
288288
"details": Object {
289-
"id": 12345,
289+
"id": 123456789,
290290
"tag": "v3-normalized-details",
291291
},
292292
"fetchChallengeFailure": false,
@@ -298,7 +298,7 @@ Object {
298298
"loadingSubmissionsForChallengeId": "",
299299
"mmSubmissions": Array [],
300300
"mySubmissions": Object {
301-
"challengeId": "12345",
301+
"challengeId": "123456789",
302302
"v2": Array [
303303
Object {
304304
"submissionId": "1",
@@ -319,7 +319,7 @@ exports[`Factory with server-side rendering Handles CHALLENGE/GET_DETAILS_DONE w
319319
Object {
320320
"checkpoints": null,
321321
"details": Object {
322-
"id": 12345,
322+
"id": 123456789,
323323
"tag": "v3-normalized-details",
324324
},
325325
"fetchChallengeFailure": "Unknown error",
@@ -331,7 +331,7 @@ Object {
331331
"loadingSubmissionsForChallengeId": "",
332332
"mmSubmissions": Array [],
333333
"mySubmissions": Object {
334-
"challengeId": "12345",
334+
"challengeId": "123456789",
335335
"v2": Array [
336336
Object {
337337
"submissionId": "1",
@@ -352,19 +352,19 @@ exports[`Factory with server-side rendering Handles CHALLENGE/GET_DETAILS_INIT a
352352
Object {
353353
"checkpoints": null,
354354
"details": Object {
355-
"id": 12345,
355+
"id": 123456789,
356356
"tag": "v3-normalized-details",
357357
},
358358
"fetchChallengeFailure": false,
359359
"loadingCheckpoints": false,
360-
"loadingDetailsForChallengeId": "12345",
360+
"loadingDetailsForChallengeId": "123456789",
361361
"loadingMMSubmissionsForChallengeId": "",
362362
"loadingResultsForChallengeId": "",
363363
"loadingSubmissionInformationForSubmissionId": "",
364364
"loadingSubmissionsForChallengeId": "",
365365
"mmSubmissions": Array [],
366366
"mySubmissions": Object {
367-
"challengeId": "12345",
367+
"challengeId": "123456789",
368368
"v2": Array [
369369
Object {
370370
"submissionId": "1",
@@ -385,7 +385,7 @@ exports[`Factory with server-side rendering Handles deleteSubmissionDone as expe
385385
Object {
386386
"checkpoints": null,
387387
"details": Object {
388-
"id": 12345,
388+
"id": 123456789,
389389
"tag": "v3-normalized-details",
390390
},
391391
"fetchChallengeFailure": "Unknown error",
@@ -397,7 +397,7 @@ Object {
397397
"loadingSubmissionsForChallengeId": "",
398398
"mmSubmissions": Array [],
399399
"mySubmissions": Object {
400-
"challengeId": "12345",
400+
"challengeId": "123456789",
401401
"v2": Array [],
402402
},
403403
"mySubmissionsManagement": Object {
@@ -416,7 +416,7 @@ exports[`Factory with server-side rendering Handles fetchSubmissionsDone as expe
416416
Object {
417417
"checkpoints": null,
418418
"details": Object {
419-
"id": 12345,
419+
"id": 123456789,
420420
"tag": "v3-normalized-details",
421421
},
422422
"fetchChallengeFailure": "Unknown error",
@@ -428,7 +428,7 @@ Object {
428428
"loadingSubmissionsForChallengeId": "",
429429
"mmSubmissions": Array [],
430430
"mySubmissions": Object {
431-
"challengeId": "12345",
431+
"challengeId": "123456789",
432432
"v2": Array [
433433
Object {
434434
"submissionId": "1",
@@ -449,7 +449,7 @@ exports[`Factory with server-side rendering Handles fetchSubmissionsDoneError as
449449
Object {
450450
"checkpoints": null,
451451
"details": Object {
452-
"id": 12345,
452+
"id": 123456789,
453453
"tag": "v3-normalized-details",
454454
},
455455
"fetchChallengeFailure": "Unknown error",
@@ -480,7 +480,7 @@ exports[`Factory with server-side rendering Handles fetchSubmissionsInit as expe
480480
Object {
481481
"checkpoints": null,
482482
"details": Object {
483-
"id": 12345,
483+
"id": 123456789,
484484
"tag": "v3-normalized-details",
485485
},
486486
"fetchChallengeFailure": "Unknown error",
@@ -489,7 +489,7 @@ Object {
489489
"loadingMMSubmissionsForChallengeId": "",
490490
"loadingResultsForChallengeId": "",
491491
"loadingSubmissionInformationForSubmissionId": "",
492-
"loadingSubmissionsForChallengeId": "12345",
492+
"loadingSubmissionsForChallengeId": "123456789",
493493
"mmSubmissions": Array [],
494494
"mySubmissions": Object {
495495
"challengeId": "",
@@ -510,7 +510,7 @@ Object {
510510
"activeChallengesCount": 5,
511511
"checkpoints": null,
512512
"details": Object {
513-
"id": 12345,
513+
"id": 123456789,
514514
"tag": "v3-normalized-details",
515515
},
516516
"fetchChallengeFailure": "Unknown error",
@@ -562,7 +562,7 @@ exports[`Factory without http request Handles CHALLENGE/GET_DETAILS_DONE as expe
562562
Object {
563563
"checkpoints": null,
564564
"details": Object {
565-
"id": 12345,
565+
"id": 123456789,
566566
"tag": "v3-normalized-details",
567567
},
568568
"fetchChallengeFailure": false,
@@ -587,7 +587,7 @@ exports[`Factory without http request Handles CHALLENGE/GET_DETAILS_DONE with er
587587
Object {
588588
"checkpoints": null,
589589
"details": Object {
590-
"id": 12345,
590+
"id": 123456789,
591591
"tag": "v3-normalized-details",
592592
},
593593
"fetchChallengeFailure": "Unknown error",
@@ -614,7 +614,7 @@ Object {
614614
"details": null,
615615
"fetchChallengeFailure": false,
616616
"loadingCheckpoints": false,
617-
"loadingDetailsForChallengeId": "12345",
617+
"loadingDetailsForChallengeId": "123456789",
618618
"loadingMMSubmissionsForChallengeId": "",
619619
"loadingResultsForChallengeId": "",
620620
"loadingSubmissionInformationForSubmissionId": "",
@@ -634,7 +634,7 @@ exports[`Factory without http request Handles deleteSubmissionDone as expected 1
634634
Object {
635635
"checkpoints": null,
636636
"details": Object {
637-
"id": 12345,
637+
"id": 123456789,
638638
"tag": "v3-normalized-details",
639639
},
640640
"fetchChallengeFailure": "Unknown error",
@@ -646,7 +646,7 @@ Object {
646646
"loadingSubmissionsForChallengeId": "",
647647
"mmSubmissions": Array [],
648648
"mySubmissions": Object {
649-
"challengeId": "12345",
649+
"challengeId": "123456789",
650650
"v2": Array [],
651651
},
652652
"mySubmissionsManagement": Object {
@@ -665,7 +665,7 @@ exports[`Factory without http request Handles fetchSubmissionsDone as expected 1
665665
Object {
666666
"checkpoints": null,
667667
"details": Object {
668-
"id": 12345,
668+
"id": 123456789,
669669
"tag": "v3-normalized-details",
670670
},
671671
"fetchChallengeFailure": "Unknown error",
@@ -677,7 +677,7 @@ Object {
677677
"loadingSubmissionsForChallengeId": "",
678678
"mmSubmissions": Array [],
679679
"mySubmissions": Object {
680-
"challengeId": "12345",
680+
"challengeId": "123456789",
681681
"v2": Array [
682682
Object {
683683
"submissionId": "1",
@@ -698,7 +698,7 @@ exports[`Factory without http request Handles fetchSubmissionsDoneError as expec
698698
Object {
699699
"checkpoints": null,
700700
"details": Object {
701-
"id": 12345,
701+
"id": 123456789,
702702
"tag": "v3-normalized-details",
703703
},
704704
"fetchChallengeFailure": "Unknown error",
@@ -729,7 +729,7 @@ exports[`Factory without http request Handles fetchSubmissionsInit as expected 1
729729
Object {
730730
"checkpoints": null,
731731
"details": Object {
732-
"id": 12345,
732+
"id": 123456789,
733733
"tag": "v3-normalized-details",
734734
},
735735
"fetchChallengeFailure": "Unknown error",
@@ -738,7 +738,7 @@ Object {
738738
"loadingMMSubmissionsForChallengeId": "",
739739
"loadingResultsForChallengeId": "",
740740
"loadingSubmissionInformationForSubmissionId": "",
741-
"loadingSubmissionsForChallengeId": "12345",
741+
"loadingSubmissionsForChallengeId": "123456789",
742742
"mmSubmissions": Array [],
743743
"mySubmissions": Object {
744744
"challengeId": "",
@@ -759,7 +759,7 @@ Object {
759759
"activeChallengesCount": 5,
760760
"checkpoints": null,
761761
"details": Object {
762-
"id": 12345,
762+
"id": 123456789,
763763
"tag": "v3-normalized-details",
764764
},
765765
"fetchChallengeFailure": "Unknown error",
@@ -811,7 +811,7 @@ exports[`Factory without server-side rendering Handles CHALLENGE/GET_DETAILS_DON
811811
Object {
812812
"checkpoints": null,
813813
"details": Object {
814-
"id": 12345,
814+
"id": 123456789,
815815
"tag": "v3-normalized-details",
816816
},
817817
"fetchChallengeFailure": false,
@@ -836,7 +836,7 @@ exports[`Factory without server-side rendering Handles CHALLENGE/GET_DETAILS_DON
836836
Object {
837837
"checkpoints": null,
838838
"details": Object {
839-
"id": 12345,
839+
"id": 123456789,
840840
"tag": "v3-normalized-details",
841841
},
842842
"fetchChallengeFailure": "Unknown error",
@@ -863,7 +863,7 @@ Object {
863863
"details": null,
864864
"fetchChallengeFailure": false,
865865
"loadingCheckpoints": false,
866-
"loadingDetailsForChallengeId": "12345",
866+
"loadingDetailsForChallengeId": "123456789",
867867
"loadingMMSubmissionsForChallengeId": "",
868868
"loadingResultsForChallengeId": "",
869869
"loadingSubmissionInformationForSubmissionId": "",
@@ -883,7 +883,7 @@ exports[`Factory without server-side rendering Handles deleteSubmissionDone as e
883883
Object {
884884
"checkpoints": null,
885885
"details": Object {
886-
"id": 12345,
886+
"id": 123456789,
887887
"tag": "v3-normalized-details",
888888
},
889889
"fetchChallengeFailure": "Unknown error",
@@ -895,7 +895,7 @@ Object {
895895
"loadingSubmissionsForChallengeId": "",
896896
"mmSubmissions": Array [],
897897
"mySubmissions": Object {
898-
"challengeId": "12345",
898+
"challengeId": "123456789",
899899
"v2": Array [],
900900
},
901901
"mySubmissionsManagement": Object {
@@ -914,7 +914,7 @@ exports[`Factory without server-side rendering Handles fetchSubmissionsDone as e
914914
Object {
915915
"checkpoints": null,
916916
"details": Object {
917-
"id": 12345,
917+
"id": 123456789,
918918
"tag": "v3-normalized-details",
919919
},
920920
"fetchChallengeFailure": "Unknown error",
@@ -926,7 +926,7 @@ Object {
926926
"loadingSubmissionsForChallengeId": "",
927927
"mmSubmissions": Array [],
928928
"mySubmissions": Object {
929-
"challengeId": "12345",
929+
"challengeId": "123456789",
930930
"v2": Array [
931931
Object {
932932
"submissionId": "1",
@@ -947,7 +947,7 @@ exports[`Factory without server-side rendering Handles fetchSubmissionsDoneError
947947
Object {
948948
"checkpoints": null,
949949
"details": Object {
950-
"id": 12345,
950+
"id": 123456789,
951951
"tag": "v3-normalized-details",
952952
},
953953
"fetchChallengeFailure": "Unknown error",
@@ -978,7 +978,7 @@ exports[`Factory without server-side rendering Handles fetchSubmissionsInit as e
978978
Object {
979979
"checkpoints": null,
980980
"details": Object {
981-
"id": 12345,
981+
"id": 123456789,
982982
"tag": "v3-normalized-details",
983983
},
984984
"fetchChallengeFailure": "Unknown error",
@@ -987,7 +987,7 @@ Object {
987987
"loadingMMSubmissionsForChallengeId": "",
988988
"loadingResultsForChallengeId": "",
989989
"loadingSubmissionInformationForSubmissionId": "",
990-
"loadingSubmissionsForChallengeId": "12345",
990+
"loadingSubmissionsForChallengeId": "123456789",
991991
"mmSubmissions": Array [],
992992
"mySubmissions": Object {
993993
"challengeId": "",
@@ -1008,7 +1008,7 @@ Object {
10081008
"activeChallengesCount": 5,
10091009
"checkpoints": null,
10101010
"details": Object {
1011-
"id": 12345,
1011+
"id": 123456789,
10121012
"tag": "v3-normalized-details",
10131013
},
10141014
"fetchChallengeFailure": "Unknown error",

‎__tests__/reducers/challenge.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ import { actions } from '../../src';
55

66
const mockChallengeActions = {
77
challenge: {
8-
getDetailsInit: mockAction('CHALLENGE/GET_DETAILS_INIT', '12345'),
8+
getDetailsInit: mockAction('CHALLENGE/GET_DETAILS_INIT', '123456789'),
99
getDetailsDone: mockAction('CHALLENGE/GET_DETAILS_DONE', Promise.resolve({
10-
id: 12345,
10+
id: 123456789,
1111
tag: 'v3-normalized-details',
1212
})),
1313
getDetailsDoneError: mockAction(
1414
'CHALLENGE/GET_DETAILS_DONE',
15-
{ challengeId: '12345' },
15+
{ challengeId: '123456789' },
1616
'Unknown error',
1717
),
18-
getSubmissionsInit: mockAction('CHALLENGE/GET_SUBMISSIONS_INIT', '12345'),
18+
getSubmissionsInit: mockAction('CHALLENGE/GET_SUBMISSIONS_INIT', '123456789'),
1919
getSubmissionsDone: mockAction(
2020
'CHALLENGE/GET_SUBMISSIONS_DONE',
21-
Promise.resolve({ challengeId: '12345', submissions: [{ submissionId: '1' }] }),
21+
Promise.resolve({ challengeId: '123456789', submissions: [{ submissionId: '1' }] }),
2222
),
2323
getSubmissionsDoneError: mockAction(
2424
'CHALLENGE/GET_SUBMISSIONS_DONE',
25-
{ challengeId: '12345' },
25+
{ challengeId: '123456789' },
2626
'Unknown error',
2727
),
2828
getActiveChallengesCountDone: mockAction('CHALLENGE/GET_ACTIVE_CHALLENGES_COUNT_DONE', 5),
@@ -64,7 +64,7 @@ function testReducer() {
6464
});
6565

6666
test('Handles CHALLENGE/GET_DETAILS_INIT as expected', () => {
67-
state = reducer(state, mockChallengeActions.challenge.getDetailsInit(12345));
67+
state = reducer(state, mockChallengeActions.challenge.getDetailsInit(123456789));
6868
expect(state).toMatchSnapshot();
6969
});
7070

@@ -139,7 +139,7 @@ describe('Factory with server-side rendering', () => {
139139
},
140140
challenge: {
141141
challengeDetails: {
142-
id: '12345',
142+
id: '123456789',
143143
mySubmission: true,
144144
},
145145
},

0 commit comments

Comments
 (0)
Please sign in to comment.