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