@@ -143,6 +143,21 @@ describe('Contest', () => {
143143 } ) ;
144144 } ) ;
145145
146+ describe ( 'when contest_id contains agc' , ( ) => {
147+ const testCases = [
148+ { contestId : 'agc001' , expected : ContestType . AGC } ,
149+ { contestId : 'agc002' , expected : ContestType . AGC } ,
150+ { contestId : 'agc009' , expected : ContestType . AGC } ,
151+ { contestId : 'agc010' , expected : ContestType . AGC } ,
152+ { contestId : 'agc011' , expected : ContestType . AGC } ,
153+ { contestId : 'agc066' , expected : ContestType . AGC } ,
154+ { contestId : 'agc067' , expected : ContestType . AGC } ,
155+ ] ;
156+
157+ runTests ( 'classifyContest' , testCases , ( { contestId, expected } : TestCaseForContestType ) => {
158+ expect ( classifyContest ( contestId ) ) . toEqual ( expected ) ;
159+ } ) ;
160+ } ) ;
146161 describe ( 'when contest_id contains chokudai_S' , ( ) => {
147162 const testCases = [
148163 { contestId : 'chokudai_S001' , expected : ContestType . OTHERS } ,
@@ -296,6 +311,26 @@ describe('Contest', () => {
296311 ) ;
297312 } ) ;
298313
314+ describe ( 'when contest_id contains agc' , ( ) => {
315+ const testCases = [
316+ { contestId : 'agc001' , expected : ContestType . AGC } ,
317+ { contestId : 'agc002' , expected : ContestType . AGC } ,
318+ { contestId : 'agc009' , expected : ContestType . AGC } ,
319+ { contestId : 'agc010' , expected : ContestType . AGC } ,
320+ { contestId : 'agc011' , expected : ContestType . AGC } ,
321+ { contestId : 'agc066' , expected : ContestType . AGC } ,
322+ { contestId : 'agc067' , expected : ContestType . AGC } ,
323+ ] ;
324+
325+ runTests (
326+ 'getContestPriority' ,
327+ testCases ,
328+ ( { contestId, expected } : TestCaseForContestType ) => {
329+ expect ( getContestPriority ( contestId ) ) . toEqual ( contestTypePriorities . get ( expected ) ) ;
330+ } ,
331+ ) ;
332+ } ) ;
333+
299334 describe ( 'when contest_id contains chokudai_S' , ( ) => {
300335 const testCases = [
301336 { contestId : 'chokudai_S001' , expected : ContestType . OTHERS } ,
@@ -470,6 +505,26 @@ describe('Contest', () => {
470505 ) ;
471506 } ) ;
472507
508+ describe ( 'when contest_id contains agc' , ( ) => {
509+ const testCases = [
510+ { contestId : 'agc001' , expected : 'AGC001' } ,
511+ { contestId : 'agc002' , expected : 'AGC002' } ,
512+ { contestId : 'agc009' , expected : 'AGC009' } ,
513+ { contestId : 'agc010' , expected : 'AGC010' } ,
514+ { contestId : 'agc011' , expected : 'AGC011' } ,
515+ { contestId : 'agc066' , expected : 'AGC066' } ,
516+ { contestId : 'agc067' , expected : 'AGC067' } ,
517+ ] ;
518+
519+ runTests (
520+ 'getContestNameLabel' ,
521+ testCases ,
522+ ( { contestId, expected } : TestCaseForContestNameLabel ) => {
523+ expect ( getContestNameLabel ( contestId ) ) . toEqual ( expected ) ;
524+ } ,
525+ ) ;
526+ } ) ;
527+
473528 describe ( 'when contest_id contains chokudai_S' , ( ) => {
474529 const testCases = [
475530 { contestId : 'chokudai_S001' , expected : 'Chokudai SpeedRun 001' } ,
@@ -680,6 +735,26 @@ describe('Contest', () => {
680735 ) ;
681736 } ) ;
682737
738+ describe ( 'when contest_id contains agc' , ( ) => {
739+ const testCases = [
740+ { contestId : 'agc001' , taskTableIndex : 'A' , expected : 'AGC001 - A' } ,
741+ { contestId : 'agc002' , taskTableIndex : 'B' , expected : 'AGC002 - B' } ,
742+ { contestId : 'agc009' , taskTableIndex : 'C' , expected : 'AGC009 - C' } ,
743+ { contestId : 'agc010' , taskTableIndex : 'D' , expected : 'AGC010 - D' } ,
744+ { contestId : 'agc011' , taskTableIndex : 'E' , expected : 'AGC011 - E' } ,
745+ { contestId : 'agc066' , taskTableIndex : 'F' , expected : 'AGC066 - F' } ,
746+ { contestId : 'agc067' , taskTableIndex : 'E' , expected : 'AGC067 - E' } ,
747+ ] ;
748+
749+ runTests (
750+ 'addContestNameToTaskIndex' ,
751+ testCases ,
752+ ( { contestId, taskTableIndex, expected } : TestCaseForContestNameAndTaskIndex ) => {
753+ expect ( addContestNameToTaskIndex ( contestId , taskTableIndex ) ) . toEqual ( expected ) ;
754+ } ,
755+ ) ;
756+ } ) ;
757+
683758 function runTests (
684759 testName : string ,
685760 testCases : TestCasesForContestNameAndTaskIndex ,
0 commit comments