UNPKG

574 BTypeScriptView Raw
1import React from "react";
2
3import { dateButton } from "@/test/elements";
4import { render } from "@/test/render";
5
6import { ModifiersDisabled } from "./ModifiersDisabled";
7
8const today = new Date(2024, 6, 22);
9
10beforeAll(() => jest.setSystemTime(today));
11afterAll(() => jest.useRealTimers());
12
13const 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
20test.each(days)("the day %s should be disabled", (day) => {
21 render(<ModifiersDisabled />);
22 // return all month's
23 expect(dateButton(day)).toBeDisabled();
24});