@@ -8,6 +8,11 @@ import { user } from "@/test/user";
88
99import { RangeMinMax } from "./RangeMinMax" ;
1010
11+ const today = new Date ( 2022 , 8 , 12 ) ;
12+
13+ beforeAll ( ( ) => jest . setSystemTime ( today ) ) ;
14+ afterAll ( ( ) => jest . useRealTimers ( ) ) ;
15+
1116beforeEach ( ( ) => render ( < RangeMinMax /> ) ) ;
1217
1318describe ( "when a day is clicked" , ( ) => {
@@ -18,22 +23,6 @@ describe("when a day is clicked", () => {
1823 test ( "should be selected" , ( ) => {
1924 expect ( gridcell ( firstDay , true ) ) . toHaveAttribute ( "aria-selected" , "true" ) ;
2025 } ) ;
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-
3726 describe ( "when the day after min is clicked" , ( ) => {
3827 const dayAfter = addDays ( firstDay , 4 ) ;
3928 beforeEach ( async ( ) => {
0 commit comments