File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed
atcoder-problems-frontend/src Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 4
4
ContestCategories ,
5
5
ContestCategory ,
6
6
} from "../../utils/ContestClassifier" ;
7
- import { isLikeContest } from "../../utils/LikeContestUtils" ;
7
+ import { isLikeContestCategory } from "../../utils/LikeContestUtils" ;
8
8
9
9
interface Props {
10
10
active : ContestCategory ;
@@ -17,7 +17,7 @@ export const TableTabButtons: React.FC<Props> = (props) => {
17
17
18
18
const filteredCategories = useMemo ( ( ) => {
19
19
return ContestCategories . filter (
20
- ( category ) => ! mergeLikeContest || ! isLikeContest ( category )
20
+ ( category ) => ! mergeLikeContest || ! isLikeContestCategory ( category )
21
21
) ;
22
22
} , [ mergeLikeContest ] ) ;
23
23
Original file line number Diff line number Diff line change 1
- import { getLikeContestCategory } from "./LikeContestUtils" ;
1
+ import {
2
+ getLikeContestCategory ,
3
+ isLikeContestCategory ,
4
+ } from "./LikeContestUtils" ;
2
5
import { ContestCategory } from "./ContestClassifier" ;
3
6
4
7
type GetLikeContestTestType = [ ContestCategory , ContestCategory | undefined ] ;
@@ -16,6 +19,25 @@ test.each<GetLikeContestTestType>([
16
19
[ "Marathon" , undefined ] ,
17
20
[ "Other Sponsored" , undefined ] ,
18
21
[ "Other Contests" , undefined ] ,
19
- ] ) ( "Get Like Contest" , ( contest , result ) => {
22
+ ] ) ( "Get Like Contest Category " , ( contest , result ) => {
20
23
expect ( getLikeContestCategory ( contest ) ) . toBe ( result ) ;
21
24
} ) ;
25
+
26
+ type IsLikeContestCategoryTestType = [ ContestCategory , boolean ] ;
27
+ test . each < IsLikeContestCategoryTestType > ( [
28
+ [ "ABC" , false ] ,
29
+ [ "ARC" , false ] ,
30
+ [ "AGC" , false ] ,
31
+ [ "ABC-Like" , true ] ,
32
+ [ "ARC-Like" , true ] ,
33
+ [ "AGC-Like" , true ] ,
34
+ [ "PAST" , false ] ,
35
+ [ "JOI" , false ] ,
36
+ [ "JAG" , false ] ,
37
+ [ "AHC" , false ] ,
38
+ [ "Marathon" , false ] ,
39
+ [ "Other Sponsored" , false ] ,
40
+ [ "Other Contests" , false ] ,
41
+ ] ) ( "Is Like Contest Category" , ( contest , result ) => {
42
+ expect ( isLikeContestCategory ( contest ) ) . toBe ( result ) ;
43
+ } ) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,6 @@ const LikeContestCategories: readonly ContestCategory[] = [
20
20
"ARC-Like" ,
21
21
"AGC-Like" ,
22
22
] ;
23
- export const isLikeContest = ( category : ContestCategory ) => {
23
+ export const isLikeContestCategory = ( category : ContestCategory ) => {
24
24
return LikeContestCategories . includes ( category ) ;
25
25
} ;
You can’t perform that action at this time.
0 commit comments