1 | import React from "react";
|
2 |
|
3 | import { render, screen } from "@/test/render";
|
4 |
|
5 | import { Weeknumber } from "./Weeknumber";
|
6 |
|
7 | const today = new Date(2021, 10, 25);
|
8 |
|
9 | beforeAll(() => jest.setSystemTime(today));
|
10 | afterAll(() => jest.useRealTimers());
|
11 |
|
12 | function getWeekButton(week: number) {
|
13 | return screen.getByRole("rowheader", {
|
14 | name: `Week ${week}`
|
15 | });
|
16 | }
|
17 |
|
18 | beforeEach(() => render(<Weeknumber />).container);
|
19 |
|
20 | describe("when displaying November 2021", () => {
|
21 | test("should display the 45th week number", () => {
|
22 | expect(getWeekButton(45)).toBeInTheDocument();
|
23 | });
|
24 | });
|