@@ -548,22 +548,19 @@ describe('Contest', () => {
548
548
} ) ;
549
549
550
550
describe ( 'get AtCoder university contest label' , ( ) => {
551
- describe ( 'expected to be thrown an error if an invalid format is given' , ( ) => {
552
- test ( 'when utpc is given' , ( ) => {
553
- expect ( ( ) => getAtCoderUniversityContestLabel ( 'utpc24' ) ) . toThrow (
554
- 'Invalid university contest ID format: utpc24' ,
555
- ) ;
556
- } ) ;
557
-
558
- test ( 'when ttpc is given' , ( ) => {
559
- expect ( ( ) => getAtCoderUniversityContestLabel ( 'ttpc' ) ) . toThrow (
560
- 'Invalid university contest ID format: ttpc' ,
561
- ) ;
551
+ describe ( 'expected to return correct label for valid format' , ( ) => {
552
+ test . each ( [
553
+ [ 'utpc2019' , 'UTPC 2019' ] ,
554
+ [ 'ttpc2022' , 'TTPC 2022' ] ,
555
+ ] ) ( 'when %s is given' , ( input , expected ) => {
556
+ expect ( getAtCoderUniversityContestLabel ( input ) ) . toBe ( expected ) ;
562
557
} ) ;
558
+ } ) ;
563
559
564
- test ( 'when tupc is given' , ( ) => {
565
- expect ( ( ) => getAtCoderUniversityContestLabel ( 'tupc' ) ) . toThrow (
566
- 'Invalid university contest ID format: tupc' ,
560
+ describe ( 'expected to be thrown an error if an invalid format is given' , ( ) => {
561
+ test . each ( [ 'utpc24' , 'ttpc' , 'tupc' ] ) ( 'when %s is given' , ( input ) => {
562
+ expect ( ( ) => getAtCoderUniversityContestLabel ( input ) ) . toThrow (
563
+ `Invalid university contest ID format: ${ input } ` ,
567
564
) ;
568
565
} ) ;
569
566
} ) ;
0 commit comments