UNPKG

830 BPlain TextView Raw
1import { CalendarDay } from "./CalendarDay";
2import { CalendarMonth } from "./CalendarMonth";
3import { CalendarWeek } from "./CalendarWeek";
4
5let month: CalendarMonth;
6let date: Date;
7let weeks: CalendarWeek[];
8const days1 = [
9 new CalendarDay(new Date(2023, 1, 12), new Date(2023, 1, 1)),
10 new CalendarDay(new Date(2023, 1, 2023), new Date(2023, 1, 1))
11];
12const days2 = [
13 new CalendarDay(new Date(2023, 1, 12), new Date(2023, 1, 1)),
14 new CalendarDay(new Date(2023, 1, 2023), new Date(2023, 1, 1))
15];
16beforeEach(() => {
17 date = new Date();
18 weeks = [new CalendarWeek(1, days1), new CalendarWeek(2, days2)];
19 month = new CalendarMonth(date, weeks);
20});
21
22it("should have a date property", () => {
23 expect(month.date).toEqual(date);
24});
25
26it("should have a weeks property", () => {
27 expect(month.weeks).toEqual(weeks);
28});