-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathdraft.util.test.ts
More file actions
28 lines (25 loc) · 991 Bytes
/
draft.util.test.ts
File metadata and controls
28 lines (25 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Categories_Event } from "@core/types/event.types";
import { assembleDefaultEvent } from "../event.util";
jest.mock("@web/auth/auth.util", () => ({
getUserId: jest.fn().mockResolvedValue("mock-user-id"),
}));
describe("assembleDefaultEvent", () => {
it("should include dates for someday event when provided", async () => {
const startDate = "2024-01-01";
const endDate = "2024-01-07";
const eventWithDates = await assembleDefaultEvent(
Categories_Event.SOMEDAY_WEEK,
startDate,
endDate,
);
expect(eventWithDates).toHaveProperty("startDate", startDate);
expect(eventWithDates).toHaveProperty("endDate", endDate);
});
it("dates should be empty for someday event when not provided", async () => {
const eventWithoutDates = await assembleDefaultEvent(
Categories_Event.SOMEDAY_WEEK,
);
expect(eventWithoutDates).toHaveProperty("startDate", "");
expect(eventWithoutDates).toHaveProperty("endDate", "");
});
});