UNPKG

723 BTypeScriptView Raw
1import React from "react";
2
3import { dateButton, gridcell } from "@/test/elements";
4import { render } from "@/test/render";
5import { user } from "@/test/user";
6
7import { TestCase2047 } from "./TestCase2047";
8
9beforeEach(async () => {
10 render(<TestCase2047 />);
11});
12
13test("disabled date is not selected", () => {
14 expect(gridcell(new Date(2024, 5, 10), true)).not.toHaveAttribute(
15 "aria-selected"
16 );
17});
18
19describe("when the calendar is focused", () => {
20 beforeEach(async () => {
21 await user.click(dateButton(new Date(2024, 5, 10)));
22 });
23 test("the disabled day should not have focused modifier", () => {
24 expect(gridcell(new Date(2024, 5, 10), true)).not.toHaveClass(
25 "rdp-focused"
26 );
27 });
28});