UNPKG

593 BTypeScriptView Raw
1import React from "react";
2
3import { gridcell } from "@/test/elements";
4import { render } from "@/test/render";
5
6import { ModifiersStyle } from "./ModifiersStyle";
7
8const today = new Date(2021, 10, 25);
9
10beforeAll(() => jest.setSystemTime(today));
11afterAll(() => jest.useRealTimers());
12
13beforeEach(() => {
14 render(<ModifiersStyle />);
15});
16
17const days = [new Date(2021, 5, 23), new Date(2021, 5, 24)];
18const style = {
19 fontWeight: 900,
20 color: "lightgreen"
21};
22test.each(days)("The day %s should have the proper inline style", (day) => {
23 expect(gridcell(day, true)).toHaveStyle(style);
24});