Skip to content

Commit 430a57c

Browse files
committed
fix(backend): fix unit test
1 parent 38a03d9 commit 430a57c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/backend/src/modules/stats/controllers/stats.private.controller.security-tests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const StatsPrivateControllerSecurityTests: AppTestHttpClientSecurityTestD
2424
response: await AppTestHttpClient.post("/stats", {
2525
context,
2626
body: {
27-
start: new Date("2021-03-31T14:32:22Z"),
28-
end: new Date("2021-04-31T14:32:22Z"),
27+
startDate: new Date("2021-03-31T14:32:22Z"),
28+
endDate: new Date("2021-04-31T14:32:22Z"),
2929
structureId,
3030
},
3131
}),
@@ -47,8 +47,8 @@ export const StatsPrivateControllerSecurityTests: AppTestHttpClientSecurityTestD
4747
response: await AppTestHttpClient.post("/stats/export", {
4848
context,
4949
body: {
50-
start: new Date("2021-03-31T14:32:22Z"),
51-
end: new Date("2021-04-31T14:32:22Z"),
50+
startDate: new Date("2021-03-31T14:32:22Z"),
51+
endDate: new Date("2021-04-31T14:32:22Z"),
5252
structureId,
5353
},
5454
}),

packages/backend/src/modules/stats/services/tests/structureStatsInPeriodGenerator.service.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ describe("structureStatsInPeriodGenerator", () => {
1414
const endDateUTC = new Date(Date.UTC(2021, 1, 1));
1515
const endDateUTCExclusive = new Date(Date.UTC(2021, 1, 2));
1616

17+
const startDate = "2019-11-15";
18+
const endDate = "2021-02-01";
19+
1720
const stats = await structureStatsInPeriodGenerator.buildStatsInPeriod({
1821
structureId: 1,
19-
startDateUTC,
20-
endDateUTCExclusive,
22+
startDate,
23+
endDate,
2124
});
2225

2326
expect(stats.structure.id).toEqual(1);

0 commit comments

Comments
 (0)