@@ -68,6 +68,7 @@ describe('filters', function() {
68
68
track : 'develop' ,
69
69
subTrack : 'CODE'
70
70
}
71
+ expect ( challengeLinksFilter ( _ch , 'submit' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=develop' )
71
72
expect ( challengeLinksFilter ( _ch , 'detail' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=develop' )
72
73
expect ( challengeLinksFilter ( _ch , 'forums' ) ) . to . be . equal ( 'https://apps.' + domain + '/forums/?module=Category&categoryID=2' )
73
74
expect ( challengeLinksFilter ( _ch , 'registrants' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=develop#viewRegistrant' )
@@ -81,23 +82,44 @@ describe('filters', function() {
81
82
track : 'design' ,
82
83
subTrack : 'WEB_DESIGN'
83
84
}
85
+ expect ( challengeLinksFilter ( _ch , 'submit' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=design' )
84
86
expect ( challengeLinksFilter ( _ch , 'detail' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=design' )
85
87
expect ( challengeLinksFilter ( _ch , 'forums' ) ) . to . be . equal ( 'https://apps.' + domain + '/forums/?module=ThreadList&forumID=2' )
86
88
expect ( challengeLinksFilter ( _ch , 'registrants' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=design#viewRegistrant' )
87
89
expect ( challengeLinksFilter ( _ch , 'submissions' ) ) . to . be . equal ( 'https://www.' + domain + '/challenge-details/1/?type=design#submissions' )
88
90
} )
89
91
90
- it ( 'should have the correct links for DATA_SCIENCE challenge' , function ( ) {
92
+ it ( 'should have the correct links for PAST DATA_SCIENCE challenge' , function ( ) {
91
93
var _ch = {
92
94
id : 1 ,
93
95
rounds : [ { id : 3 , forumId : 2 } ] ,
94
96
track : 'DATA_SCIENCE' ,
95
- subTrack : 'MARATHON_MATCH'
97
+ subTrack : 'MARATHON_MATCH' ,
98
+ componentId : 4 ,
99
+ problemId : 5 ,
100
+ status : 'PAST'
96
101
}
102
+ expect ( challengeLinksFilter ( _ch , 'submit' ) ) . to . be . equal ( 'https://community.' + domain + '/longcontest/?module=Submit&compid=4&rd=3&cd=1' )
97
103
expect ( challengeLinksFilter ( _ch , 'detail' ) ) . to . be . equal ( 'https://community.' + domain + '/longcontest/stats/?module=ViewOverview&rd=3' )
98
104
expect ( challengeLinksFilter ( _ch , 'forums' ) ) . to . be . equal ( 'https://apps.' + domain + '/forums/?module=ThreadList&forumID=2' )
99
105
expect ( challengeLinksFilter ( _ch , 'registrants' ) ) . to . be . equal ( 'https://community.' + domain + '/longcontest/?module=ViewRegistrants&rd=3' )
100
106
} )
107
+
108
+ it ( 'should have the correct links for ACTIVE/UPCOMING DATA_SCIENCE challenge' , function ( ) {
109
+ var _ch = {
110
+ id : 1 ,
111
+ rounds : [ { id : 3 , forumId : 2 } ] ,
112
+ track : 'DATA_SCIENCE' ,
113
+ subTrack : 'MARATHON_MATCH' ,
114
+ componentId : 4 ,
115
+ problemId : 5 ,
116
+ status : 'ACTIVE'
117
+ }
118
+ expect ( challengeLinksFilter ( _ch , 'submit' ) ) . to . be . equal ( 'https://community.' + domain + '/longcontest/?module=Submit&compid=4&rd=3&cd=1' )
119
+ expect ( challengeLinksFilter ( _ch , 'detail' ) ) . to . be . equal ( 'https://community.' + domain + '/longcontest/?module=ViewProblemStatement&pm=5&rd=3' )
120
+ expect ( challengeLinksFilter ( _ch , 'forums' ) ) . to . be . equal ( 'https://apps.' + domain + '/forums/?module=ThreadList&forumID=2' )
121
+ expect ( challengeLinksFilter ( _ch , 'registrants' ) ) . to . be . equal ( 'https://community.' + domain + '/longcontest/?module=ViewRegistrants&rd=3' )
122
+ } )
101
123
} )
102
124
103
125
describe ( 'externalLinkColorFilter' , function ( ) {
0 commit comments