1 | import React from "react";
|
2 |
|
3 | import { dateButton } from "@/test/elements";
|
4 | import { render } from "@/test/render";
|
5 |
|
6 | import { ModifiersDisabled } from "./ModifiersDisabled";
|
7 |
|
8 | const today = new Date(2024, 6, 22);
|
9 |
|
10 | beforeAll(() => jest.setSystemTime(today));
|
11 | afterAll(() => jest.useRealTimers());
|
12 |
|
13 | const days = [
|
14 | new Date(2024, 6, 6),
|
15 | new Date(2024, 6, 13),
|
16 | new Date(2024, 6, 20),
|
17 | new Date(2024, 6, 27)
|
18 | ];
|
19 |
|
20 | test.each(days)("the day %s should be disabled", (day) => {
|
21 | render(<ModifiersDisabled />);
|
22 |
|
23 | expect(dateButton(day)).toBeDisabled();
|
24 | });
|