Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vpClockodo committed Oct 16, 2023
1 parent 14a5b17 commit e4ba3d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/models/__snapshots__/workTimes.mocks.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Array [
"type": 1,
},
],
"createdAt": "2020-03-24",
"createdAt": "2020-03-24T14:09:16Z",
"date": "2020-03-24",
"id": 0,
"status": 1,
Expand All @@ -44,7 +44,7 @@ Array [
"type": 2,
},
],
"createdAt": "2020-04-14",
"createdAt": "2020-04-14T07:21:31Z",
"date": "2020-04-14",
"id": 1,
"status": 1,
Expand All @@ -58,7 +58,7 @@ Array [
"type": 2,
},
],
"createdAt": "2020-06-05",
"createdAt": "2020-06-05T05:25:56Z",
"date": "2020-06-05",
"id": 2,
"status": 1,
Expand All @@ -82,7 +82,7 @@ Array [
"type": 1,
},
],
"createdAt": "2020-09-11",
"createdAt": "2020-09-11T06:00:33Z",
"date": "2020-09-11",
"id": 3,
"status": 1,
Expand All @@ -101,7 +101,7 @@ Array [
"type": 1,
},
],
"createdAt": "2020-09-17",
"createdAt": "2020-09-17T11:08:48Z",
"date": "2020-09-17",
"id": 4,
"status": 1,
Expand Down
3 changes: 2 additions & 1 deletion src/models/workTimes.mocks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { faker } from "@faker-js/faker";
import {
isoDateFromDateTime,
isoUtcDateTimeFromDateTime,
isoUtcDateTimeFromTimestamp,
} from "../lib/dateTime.js";
import {
Expand Down Expand Up @@ -117,7 +118,7 @@ const createChangeRequest = ({
date,
});
const isoDate = isoDateFromDateTime(date);
const isoCreatedAt = isoDateFromDateTime(createdAt ?? new Date());
const isoCreatedAt = isoUtcDateTimeFromDateTime(createdAt ?? new Date());

return {
id,
Expand Down
2 changes: 1 addition & 1 deletion src/models/workTimes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type WorkTimeChangeRequest = {
id: number;
date: IsoDate;
usersId: number;
createdAt: IsoDate;
createdAt: IsoUtcDateTime;
changes: Array<WorkTimeChangeRequestInterval>;
} & (
| {
Expand Down

0 comments on commit e4ba3d8

Please sign in to comment.