@@ -62,91 +62,127 @@ describe('EndpointsService', () => {
6262 expect ( endpointsService . allHostTeamsURL ( ) ) . toBe ( 'hosts/challenge_host_team' ) ;
6363 } ) ;
6464 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' ) ;
6667 } ) ;
6768 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/' ) ;
6971 } ) ;
7072 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/' ) ;
7275 } ) ;
7376 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' ) ;
7579 } ) ;
7680 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' ) ;
7884 } ) ;
7985 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' ) ;
8188 } ) ;
8289 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' ) ;
8493 } ) ;
8594 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' ) ;
8797 } ) ;
8898 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/' ) ;
90101 } ) ;
91102 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' ) ;
93105 } ) ;
94106 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/' ) ;
96109 } ) ;
97110 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/' ) ;
99114 } ) ;
100115 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' ) )
102119 . toBe ( 'jobs/challenge/2/challenge_phase/3/submission?participant_team__team_name=team_name' ) ;
103120 } ) ;
104121 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' ) ;
106125 } ) ;
107126 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' ) )
109130 . toBe ( 'challenges/2/phase/3/download_all_submissions/id/' ) ;
110131 } ) ;
111132 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 ) )
113136 . toBe ( 'analytics/challenge/2/challenge_phase/3/count' ) ;
114137 } ) ;
115138 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 ) )
117143 . toBe ( 'jobs/challenge/2/challenge_phase/3/submission/4' ) ;
118144 } ) ;
119145 it ( 'should return challenge submission remaining url' , ( ) => {
120- expect ( endpointsService . challengeSubmissionsRemainingURL ( 2 ) )
146+ const hostId = 2 ;
147+ expect ( endpointsService . challengeSubmissionsRemainingURL ( hostId ) )
121148 . toBe ( 'jobs/2/remaining_submissions' ) ;
122149 } ) ;
123150 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 ) )
125153 . toBe ( 'challenges/challenge_host_team/host_team/challenge/2' ) ;
126154 } ) ;
127155 it ( 'should return challenge delete url' , ( ) => {
128- expect ( endpointsService . deleteChallengeURL ( 2 ) )
156+ const hostId = 2 ;
157+ expect ( endpointsService . deleteChallengeURL ( hostId ) )
129158 . toBe ( 'challenges/challenge/2/disable' ) ;
130159 } ) ;
131160
132161 it ( 'should return challenge re-run submission url' , ( ) => {
133- expect ( endpointsService . reRunSubmissionURL ( 2 ) )
162+ const hostId = 2 ;
163+ expect ( endpointsService . reRunSubmissionURL ( hostId ) )
134164 . toBe ( 'jobs/submissions/2/re-run/' ) ;
135165 } ) ;
136166 it ( 'should return team count analytics url' , ( ) => {
137- expect ( endpointsService . teamCountAnalyticsURL ( 2 ) )
167+ const hostId = 2 ;
168+ expect ( endpointsService . teamCountAnalyticsURL ( hostId ) )
138169 . toBe ( 'analytics/challenge/2/team/count' ) ;
139170 } ) ;
140171 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 ) )
142175 . toBe ( 'analytics/challenge/2/challenge_phase/3/analytics' ) ;
143176 } ) ;
144177 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 ) )
146181 . toBe ( 'analytics/challenge/2/challenge_phase/3/last_submission_datetime_analysis/' ) ;
147182 } ) ;
148183 it ( 'should return participants analytics url' , ( ) => {
149- expect ( endpointsService . downloadParticipantsAnalyticsURL ( 2 ) )
184+ const hostId = 2 ;
185+ expect ( endpointsService . downloadParticipantsAnalyticsURL ( hostId ) )
150186 . toBe ( 'analytics/challenges/2/download_all_participants/' ) ;
151187 } ) ;
152188
0 commit comments