@@ -8,6 +8,11 @@ import { user } from "@/test/user";
8
8
9
9
import { RangeMinMax } from "./RangeMinMax" ;
10
10
11
+ const today = new Date ( 2022 , 8 , 12 ) ;
12
+
13
+ beforeAll ( ( ) => jest . setSystemTime ( today ) ) ;
14
+ afterAll ( ( ) => jest . useRealTimers ( ) ) ;
15
+
11
16
beforeEach ( ( ) => render ( < RangeMinMax /> ) ) ;
12
17
13
18
describe ( "when a day is clicked" , ( ) => {
@@ -18,22 +23,6 @@ describe("when a day is clicked", () => {
18
23
test ( "should be selected" , ( ) => {
19
24
expect ( gridcell ( firstDay , true ) ) . toHaveAttribute ( "aria-selected" , "true" ) ;
20
25
} ) ;
21
- describe ( "when the day before min is clicked" , ( ) => {
22
- const dayAfter = addDays ( firstDay , 1 ) ;
23
- beforeEach ( async ( ) => {
24
- await user . click ( dateButton ( dayAfter ) ) ;
25
- } ) ;
26
- test ( "the first day should not be selected" , ( ) => {
27
- expect ( gridcell ( firstDay , true ) ) . not . toHaveAttribute (
28
- "aria-selected" ,
29
- "true"
30
- ) ;
31
- } ) ;
32
- test ( "the day after should be selected" , ( ) => {
33
- expect ( gridcell ( dayAfter , true ) ) . toHaveAttribute ( "aria-selected" , "true" ) ;
34
- } ) ;
35
- } ) ;
36
-
37
26
describe ( "when the day after min is clicked" , ( ) => {
38
27
const dayAfter = addDays ( firstDay , 4 ) ;
39
28
beforeEach ( async ( ) => {
0 commit comments