Skip to content

Commit 53d8bc7

Browse files
committed
update: write the tests with vitest
1 parent a42c6f8 commit 53d8bc7

14 files changed

+68
-39
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
dailyProblem,
88
problems,
99
selectProblem,
10+
userCalendar,
1011
} from './mockData';
1112

1213
export const handlers = [
@@ -41,6 +42,10 @@ export const handlers = [
4142
return msw.HttpResponse.json(selectProblem);
4243
}
4344

45+
if (typed.query.indexOf('UserProfileCalendar') !== -1) {
46+
return msw.HttpResponse.json(userCalendar);
47+
}
48+
4449
return msw.HttpResponse.json({});
4550
}),
4651
];
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export { default as singleUserContests } from './singleUserContests.json';
55
export { default as dailyProblem } from './dailyProblem.json';
66
export { default as problems } from './problems.json';
77
export { default as selectProblem } from './selectProblem.json';
8+
export { default as userCalendar } from './userCalendar.json';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"data": {
3+
"matchedUser": {
4+
"userCalendar": {
5+
"activeYears": [2023, 2024],
6+
"streak": 5,
7+
"totalActiveDays": 120,
8+
"dccBadges": [
9+
{
10+
"timestamp": 1704153600,
11+
"badge": {
12+
"name": "Jan LeetCoding Challenge",
13+
"icon": "/static/images/badges/dcc-2024-1.png"
14+
}
15+
}
16+
],
17+
"submissionCalendar": "{\"1704153600\": 24, \"1704240000\": 9, \"1704326400\": 5, \"1704412800\": 3, \"1705017600\": 1, \"1705104000\": 6, \"1699315200\": 46, \"1701302400\": 6, \"1701648000\": 24, \"1701734400\": 11, \"1702339200\": 29, \"1702425600\": 7}"
18+
}
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)