|
| 1 | +import { getLikeContest, hasLikeContest } from "./LikeContestUtils"; |
| 2 | +import { ContestCategory } from "./ContestClassifier"; |
| 3 | + |
| 4 | +type GetLikeContestTestType = [ContestCategory, ContestCategory | undefined]; |
| 5 | +test.each<GetLikeContestTestType>([ |
| 6 | + ["ABC", "ABC-Like"], |
| 7 | + ["ARC", "ARC-Like"], |
| 8 | + ["AGC", "AGC-Like"], |
| 9 | + ["ABC-Like", undefined], |
| 10 | + ["ARC-Like", undefined], |
| 11 | + ["AGC-Like", undefined], |
| 12 | + ["PAST", undefined], |
| 13 | + ["JOI", undefined], |
| 14 | + ["JAG", undefined], |
| 15 | + ["AHC", undefined], |
| 16 | + ["Marathon", undefined], |
| 17 | + ["Other Sponsored", undefined], |
| 18 | + ["Other Contests", undefined], |
| 19 | +])("Get Like Contest", (contest, result) => { |
| 20 | + expect(getLikeContest(contest)).toBe(result); |
| 21 | +}); |
| 22 | + |
| 23 | +type HasLikeContestTestType = [ContestCategory, boolean]; |
| 24 | +test.each<HasLikeContestTestType>([ |
| 25 | + ["ABC", true], |
| 26 | + ["ARC", true], |
| 27 | + ["AGC", true], |
| 28 | + ["ABC-Like", false], |
| 29 | + ["ARC-Like", false], |
| 30 | + ["AGC-Like", false], |
| 31 | + ["PAST", false], |
| 32 | + ["JOI", false], |
| 33 | + ["JAG", false], |
| 34 | + ["AHC", false], |
| 35 | + ["Marathon", false], |
| 36 | + ["Other Sponsored", false], |
| 37 | + ["Other Contests", false], |
| 38 | +])(`Has Like Contest`, (contest, result) => { |
| 39 | + expect(hasLikeContest(contest)).toBe(result); |
| 40 | +}); |
0 commit comments