Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Commit d59fe7d

Browse files
committed
fix_spacing_and_suggested_changes
1 parent 316b492 commit d59fe7d

File tree

11 files changed

+86
-49
lines changed

11 files changed

+86
-49
lines changed

src/app/components/analytics/analytics.component.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,4 @@ describe('AnalyticsComponent', () => {
5454
expect(component).toBeTruthy();
5555
});
5656

57-
it('should call ngOninit', () => {
58-
component.ngOnInit();
59-
});
60-
61-
it('should call ngOnDestroy', () => {
62-
component.ngOnDestroy();
63-
});
6457
});

src/app/components/analytics/host-analytics/host-analytics.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('HostAnalyticsComponent', () => {
120120
expect(service.getUrl).toHaveBeenCalled();
121121
expect(service3.teamCountAnalyticsURL).toHaveBeenCalled();
122122
}));
123-
it('should show download challenge participant team', inject([EndpointsService, ApiService],
123+
it('should download challenge participant team', inject([EndpointsService, ApiService],
124124
(service: EndpointsService, service2: ApiService) => {
125125
const result = {
126126
'results' : [{'id': '1'}],

src/app/components/auth/login/login.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('LoginComponent', () => {
6767
spyOn(service2, 'postUrl').and.returnValue(new Observable((observation) => {
6868
observation.next({'token': [{}]});
6969
observation.complete();
70-
return{unsubscribe() {}};
70+
return {unsubscribe() {}};
7171
}));
7272
fixture.detectChanges();
7373
component.userLogin(false);
@@ -78,7 +78,7 @@ describe('LoginComponent', () => {
7878
let err = {};
7979
spyOn(service, 'postUrl').and.returnValue(new Observable((observation) => {
8080
observation.error(err);
81-
return{unsubscribe() {}};
81+
return {unsubscribe() {}};
8282
}));
8383
fixture.detectChanges();
8484
component.userLogin(true);

src/app/components/auth/reset-password-confirm/reset-password-confirm.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('ResetPasswordConfirmComponent', () => {
4444
spyOn(service, 'postUrl').and.returnValue(new Observable((observation) => {
4545
observation.next({'data': {'detail': 'detail_goes_here'}});
4646
observation.complete();
47-
return{unsubscribe() {}};
47+
return {unsubscribe() {}};
4848
}));
4949
fixture.detectChanges();
5050
component.resetPasswordConfirm(false);

src/app/components/auth/reset-password/reset-password.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('ResetPasswordComponent', () => {
3636
spyOn(service, 'postUrl').and.returnValue(new Observable((observation) => {
3737
observation.next({'detail': 'testing_detail_goes_here'});
3838
observation.complete();
39-
return{unsubscribe() {}};
39+
return {unsubscribe() {}};
4040
}));
4141
fixture.detectChanges();
4242
component.resetPassword(false);
@@ -47,7 +47,7 @@ describe('ResetPasswordComponent', () => {
4747
const error = {};
4848
spyOn(service, 'postUrl').and.returnValue(new Observable((observation) => {
4949
observation.error(error);
50-
return{unsubscribe() {}};
50+
return {unsubscribe() {}};
5151
}));
5252
fixture.detectChanges();
5353
component.resetPassword(true);

src/app/components/auth/signup/signup.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('SignupComponent', () => {
4646
spyOn(service, 'postUrl').and.returnValue(new Observable((observation) => {
4747
observation.next({'status': 201});
4848
observation.complete();
49-
return{unsubscribe() {}};
49+
return {unsubscribe() {}};
5050
}));
5151
fixture.detectChanges();
5252
component.userSignUp(false);
@@ -57,7 +57,7 @@ describe('SignupComponent', () => {
5757
let err = {};
5858
spyOn(service, 'postUrl').and.returnValue(new Observable((observation) => {
5959
observation.error(err);
60-
return{unsubscribe() {}};
60+
return {unsubscribe() {}};
6161
}));
6262
fixture.detectChanges();
6363
component.userSignUp(true);

src/app/components/auth/verify-email/verify-email.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('VerifyEmailComponent', () => {
3636
spyOn(authService, 'verifyEmail').and.returnValue(new Observable((observation) => {
3737
observation.next({});
3838
observation.complete();
39-
return{unsubscribe() {}};
39+
return {unsubscribe() {}};
4040
}));
4141
expect(component).toBeTruthy();
4242
});

src/app/components/challenge-create/challenge-create.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('ChallengecreateComponent', () => {
7575
observation.next(result);
7676
observation.error(result);
7777
observation.complete();
78-
return{unsubscribe() {}};
78+
return {unsubscribe() {}};
7979
}));
8080
fixture.detectChanges();
8181
component.challengeCreate();

src/app/components/publiclists/teamlist/teamlist.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('TeamlistComponent', () => {
9191
observation.next(data);
9292
observation.error(data);
9393
observation.complete();
94-
return{unsubscribe() {}};
94+
return {unsubscribe() {}};
9595
}));
9696
fixture.detectChanges();
9797
});

src/app/services/endpoints.service.spec.ts

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/app/services/global.service.spec.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@ describe('GlobalService', () => {
1414
expect(service).toBeTruthy();
1515
}));
1616
it('should update scroll Data', () => {
17-
expect(globalService.scrolledStateChange(true)).toBeUndefined();
17+
const isScroll = true;
18+
expect(globalService.scrolledStateChange(isScroll)).toBeUndefined();
1819
});
1920
it('should Store Data', () => {
20-
expect(globalService.storeData(6, 1)).toBe();
21+
const key = 6;
22+
const value = 1;
23+
expect(globalService.storeData(key, value)).toBe();
2124
});
2225
it('should Get Data', () => {
23-
expect(globalService.getData(6)).toBe(1);
26+
const key = 6;
27+
const value = 1;
28+
expect(globalService.getData(key)).toBe(value);
2429
});
2530
it('should Delete Data', () => {
26-
expect(globalService.deleteData(6)).toBe();
31+
const key = 6;
32+
expect(globalService.deleteData(key)).toBe();
2733
});
2834
it('should Reset Store', () => {
2935
expect(globalService.resetStorage()).toBe();
@@ -125,9 +131,11 @@ describe('GlobalService', () => {
125131

126132
});
127133
it('should Show Integer Validation', () => {
128-
expect(globalService.validateInteger(19)).toBe(true);
134+
const intValue = 19;
135+
const negativeInteger = -19;
136+
expect(globalService.validateInteger(intValue)).toBe(true);
129137

130-
expect(globalService.validateInteger(-19)).toBe(false);
138+
expect(globalService.validateInteger(negativeInteger)).toBe(false);
131139
});
132140
it('should Show password Validation', () => {
133141
expect(globalService.validatePassword('Password String')).toBe(true);

0 commit comments

Comments
 (0)