1 | import React from "react";
|
2 |
|
3 | import { screen, render } from "@/test/render";
|
4 |
|
5 | import { ModifiersHidden } from "./ModifiersHidden";
|
6 |
|
7 | const days = [
|
8 | new Date(2022, 5, 10),
|
9 | new Date(2022, 5, 20),
|
10 | new Date(2022, 5, 11)
|
11 | ];
|
12 |
|
13 | const today = new Date(2021, 10, 25);
|
14 |
|
15 | beforeAll(() => jest.setSystemTime(today));
|
16 | afterAll(() => jest.useRealTimers());
|
17 |
|
18 | test.each(days)("the day %s should be hidden", (day) => {
|
19 | render(<ModifiersHidden />);
|
20 | expect(
|
21 | screen.queryByRole("gridcell", { name: `${day.getDate()}` })
|
22 | ).not.toBeInTheDocument();
|
23 | });
|