UNPKG

543 BTypeScriptView Raw
1import React from "react";
2
3import { screen, render } from "@/test/render";
4
5import { ModifiersHidden } from "./ModifiersHidden";
6
7const days = [
8 new Date(2022, 5, 10),
9 new Date(2022, 5, 20),
10 new Date(2022, 5, 11)
11];
12
13const today = new Date(2021, 10, 25);
14
15beforeAll(() => jest.setSystemTime(today));
16afterAll(() => jest.useRealTimers());
17
18test.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});