@@ -62,91 +62,127 @@ describe('EndpointsService', () => {
62
62
expect ( endpointsService . allHostTeamsURL ( ) ) . toBe ( 'hosts/challenge_host_team' ) ;
63
63
} ) ;
64
64
it ( 'should return invite member to host team url' , ( ) => {
65
- expect ( endpointsService . hostTeamInviteURL ( 2 ) ) . toBe ( 'hosts/challenge_host_teams/2/invite' ) ;
65
+ const hostId = 2 ;
66
+ expect ( endpointsService . hostTeamInviteURL ( hostId ) ) . toBe ( 'hosts/challenge_host_teams/2/invite' ) ;
66
67
} ) ;
67
68
it ( 'should return challenge detail url' , ( ) => {
68
- expect ( endpointsService . challengeDetailsURL ( 2 ) ) . toBe ( 'challenges/challenge/2/' ) ;
69
+ const hostId = 2 ;
70
+ expect ( endpointsService . challengeDetailsURL ( hostId ) ) . toBe ( 'challenges/challenge/2/' ) ;
69
71
} ) ;
70
72
it ( 'should return challenge star url' , ( ) => {
71
- expect ( endpointsService . challengeStarsURL ( 2 ) ) . toBe ( 'challenges/2/' ) ;
73
+ const hostId = 2 ;
74
+ expect ( endpointsService . challengeStarsURL ( hostId ) ) . toBe ( 'challenges/2/' ) ;
72
75
} ) ;
73
76
it ( 'should return challenge participant teams url' , ( ) => {
74
- expect ( endpointsService . challengeParticipantTeamsURL ( 2 ) ) . toBe ( 'participants/participant_teams/challenges/2/user' ) ;
77
+ const hostId = 2 ;
78
+ expect ( endpointsService . challengeParticipantTeamsURL ( hostId ) ) . toBe ( 'participants/participant_teams/challenges/2/user' ) ;
75
79
} ) ;
76
80
it ( 'should return participate url' , ( ) => {
77
- expect ( endpointsService . challengeParticipateURL ( 2 , 3 ) ) . toBe ( 'challenges/challenge/2/participant_team/3' ) ;
81
+ const hostId = 2 ;
82
+ const participantId = 3 ;
83
+ expect ( endpointsService . challengeParticipateURL ( hostId , participantId ) ) . toBe ( 'challenges/challenge/2/participant_team/3' ) ;
78
84
} ) ;
79
85
it ( 'should return challenge phase url' , ( ) => {
80
- expect ( endpointsService . challengePhaseURL ( 2 ) ) . toBe ( 'challenges/challenge/2/challenge_phase' ) ;
86
+ const hostId = 2 ;
87
+ expect ( endpointsService . challengePhaseURL ( hostId ) ) . toBe ( 'challenges/challenge/2/challenge_phase' ) ;
81
88
} ) ;
82
89
it ( 'should return update challenge detail url' , ( ) => {
83
- expect ( endpointsService . updateChallengePhaseDetailsURL ( 2 , 3 ) ) . toBe ( 'challenges/challenge/2/challenge_phase/3' ) ;
90
+ const hostId = 2 ;
91
+ const participantId = 3 ;
92
+ expect ( endpointsService . updateChallengePhaseDetailsURL ( hostId , participantId ) ) . toBe ( 'challenges/challenge/2/challenge_phase/3' ) ;
84
93
} ) ;
85
94
it ( 'should return challenge phase split url' , ( ) => {
86
- expect ( endpointsService . challengePhaseSplitURL ( 2 ) ) . toBe ( 'challenges/2/challenge_phase_split' ) ;
95
+ const hostId = 2 ;
96
+ expect ( endpointsService . challengePhaseSplitURL ( hostId ) ) . toBe ( 'challenges/2/challenge_phase_split' ) ;
87
97
} ) ;
88
98
it ( 'should return challenge create url' , ( ) => {
89
- expect ( endpointsService . challengeCreateURL ( 2 ) ) . toBe ( 'challenges/challenge/challenge_host_team/2/zip_upload/' ) ;
99
+ const hostId = 2 ;
100
+ expect ( endpointsService . challengeCreateURL ( hostId ) ) . toBe ( 'challenges/challenge/challenge_host_team/2/zip_upload/' ) ;
90
101
} ) ;
91
102
it ( 'should return challenge leaderboard url' , ( ) => {
92
- expect ( endpointsService . challengeLeaderboardURL ( 3 ) ) . toBe ( 'jobs/challenge_phase_split/3/leaderboard/?page_size=1000' ) ;
103
+ const participantId = 3 ;
104
+ expect ( endpointsService . challengeLeaderboardURL ( participantId ) ) . toBe ( 'jobs/challenge_phase_split/3/leaderboard/?page_size=1000' ) ;
93
105
} ) ;
94
106
it ( 'should return challenge phase split url' , ( ) => {
95
- expect ( endpointsService . particularChallengePhaseSplitUrl ( 3 ) ) . toBe ( 'challenges/challenge/create/challenge_phase_split/3/' ) ;
107
+ const participantId = 3 ;
108
+ expect ( endpointsService . particularChallengePhaseSplitUrl ( participantId ) ) . toBe ( 'challenges/challenge/create/challenge_phase_split/3/' ) ;
96
109
} ) ;
97
110
it ( 'should return challenge submission url' , ( ) => {
98
- expect ( endpointsService . challengeSubmissionURL ( 2 , 3 ) ) . toBe ( 'jobs/challenge/2/challenge_phase/3/submission/' ) ;
111
+ const hostId = 2 ;
112
+ const participantId = 3 ;
113
+ expect ( endpointsService . challengeSubmissionURL ( hostId , participantId ) ) . toBe ( 'jobs/challenge/2/challenge_phase/3/submission/' ) ;
99
114
} ) ;
100
115
it ( 'should return challenge submission with filter url' , ( ) => {
101
- expect ( endpointsService . challengeSubmissionWithFilterQueryURL ( 2 , 3 , 'team_name' ) )
116
+ const hostId = 2 ;
117
+ const participantId = 3 ;
118
+ expect ( endpointsService . challengeSubmissionWithFilterQueryURL ( hostId , participantId , 'team_name' ) )
102
119
. toBe ( 'jobs/challenge/2/challenge_phase/3/submission?participant_team__team_name=team_name' ) ;
103
120
} ) ;
104
121
it ( 'should return all challenge submission url' , ( ) => {
105
- expect ( endpointsService . allChallengeSubmissionURL ( 2 , 3 ) ) . toBe ( 'challenges/2/challenge_phase/3/submissions' ) ;
122
+ const hostId = 2 ;
123
+ const participantId = 3 ;
124
+ expect ( endpointsService . allChallengeSubmissionURL ( hostId , participantId ) ) . toBe ( 'challenges/2/challenge_phase/3/submissions' ) ;
106
125
} ) ;
107
126
it ( 'should return challenge submission download url' , ( ) => {
108
- expect ( endpointsService . challengeSubmissionDownloadURL ( 2 , 3 , 'id' ) )
127
+ const hostId = 2 ;
128
+ const participantId = 3 ;
129
+ expect ( endpointsService . challengeSubmissionDownloadURL ( hostId , participantId , 'id' ) )
109
130
. toBe ( 'challenges/2/phase/3/download_all_submissions/id/' ) ;
110
131
} ) ;
111
132
it ( 'should return challenge submission count url' , ( ) => {
112
- expect ( endpointsService . challengeSubmissionCountURL ( 2 , 3 ) )
133
+ const hostId = 2 ;
134
+ const participantId = 3 ;
135
+ expect ( endpointsService . challengeSubmissionCountURL ( hostId , participantId ) )
113
136
. toBe ( 'analytics/challenge/2/challenge_phase/3/count' ) ;
114
137
} ) ;
115
138
it ( 'should return challenge submission update url' , ( ) => {
116
- expect ( endpointsService . challengeSubmissionUpdateURL ( 2 , 3 , 4 ) )
139
+ const hostId = 2 ;
140
+ const participantId = 3 ;
141
+ const submissionId = 4 ;
142
+ expect ( endpointsService . challengeSubmissionUpdateURL ( hostId , participantId , submissionId ) )
117
143
. toBe ( 'jobs/challenge/2/challenge_phase/3/submission/4' ) ;
118
144
} ) ;
119
145
it ( 'should return challenge submission remaining url' , ( ) => {
120
- expect ( endpointsService . challengeSubmissionsRemainingURL ( 2 ) )
146
+ const hostId = 2 ;
147
+ expect ( endpointsService . challengeSubmissionsRemainingURL ( hostId ) )
121
148
. toBe ( 'jobs/2/remaining_submissions' ) ;
122
149
} ) ;
123
150
it ( 'should return challenge edit details url' , ( ) => {
124
- expect ( endpointsService . editChallengeDetailsURL ( 'host_team' , 2 ) )
151
+ const hostId = 2 ;
152
+ expect ( endpointsService . editChallengeDetailsURL ( 'host_team' , hostId ) )
125
153
. toBe ( 'challenges/challenge_host_team/host_team/challenge/2' ) ;
126
154
} ) ;
127
155
it ( 'should return challenge delete url' , ( ) => {
128
- expect ( endpointsService . deleteChallengeURL ( 2 ) )
156
+ const hostId = 2 ;
157
+ expect ( endpointsService . deleteChallengeURL ( hostId ) )
129
158
. toBe ( 'challenges/challenge/2/disable' ) ;
130
159
} ) ;
131
160
132
161
it ( 'should return challenge re-run submission url' , ( ) => {
133
- expect ( endpointsService . reRunSubmissionURL ( 2 ) )
162
+ const hostId = 2 ;
163
+ expect ( endpointsService . reRunSubmissionURL ( hostId ) )
134
164
. toBe ( 'jobs/submissions/2/re-run/' ) ;
135
165
} ) ;
136
166
it ( 'should return team count analytics url' , ( ) => {
137
- expect ( endpointsService . teamCountAnalyticsURL ( 2 ) )
167
+ const hostId = 2 ;
168
+ expect ( endpointsService . teamCountAnalyticsURL ( hostId ) )
138
169
. toBe ( 'analytics/challenge/2/team/count' ) ;
139
170
} ) ;
140
171
it ( 'should return challenge phase analytics url' , ( ) => {
141
- expect ( endpointsService . challengePhaseAnalyticsURL ( 2 , 3 ) )
172
+ const hostId = 2 ;
173
+ const participantId = 3 ;
174
+ expect ( endpointsService . challengePhaseAnalyticsURL ( hostId , participantId ) )
142
175
. toBe ( 'analytics/challenge/2/challenge_phase/3/analytics' ) ;
143
176
} ) ;
144
177
it ( 'should return last submission analytics url' , ( ) => {
145
- expect ( endpointsService . lastSubmissionAnalyticsURL ( 2 , 3 ) )
178
+ const hostId = 2 ;
179
+ const participantId = 3 ;
180
+ expect ( endpointsService . lastSubmissionAnalyticsURL ( hostId , participantId ) )
146
181
. toBe ( 'analytics/challenge/2/challenge_phase/3/last_submission_datetime_analysis/' ) ;
147
182
} ) ;
148
183
it ( 'should return participants analytics url' , ( ) => {
149
- expect ( endpointsService . downloadParticipantsAnalyticsURL ( 2 ) )
184
+ const hostId = 2 ;
185
+ expect ( endpointsService . downloadParticipantsAnalyticsURL ( hostId ) )
150
186
. toBe ( 'analytics/challenges/2/download_all_participants/' ) ;
151
187
} ) ;
152
188
0 commit comments