File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -29,18 +29,20 @@ describe('The `useResize` service', () => {
29
29
expect ( fn ) . not . toHaveBeenCalled ( ) ;
30
30
} ) ;
31
31
32
- it ( 'should return the current active breakpoint' , ( ) => {
33
- const service = useResize ( { s : '0px' , m : '1024px ' , l : '2048px' } ) ;
32
+ it ( 'should return the current active breakpoint' , async ( ) => {
33
+ const service = useResize ( { s : '0px' , m : '1025px ' , l : '2048px' } ) ;
34
34
expect ( service . props ( ) . breakpoints ) . toEqual ( [ 's' , 'm' , 'l' ] ) ;
35
35
36
- useMatchMedia ( '(min-width: 1024px)' ) ;
36
+ await resizeWindow ( { width : 1025 } ) ;
37
+ useMatchMedia ( '(min-width: 1025px)' ) ;
37
38
expect ( service . props ( ) . activeBreakpoints ) . toEqual ( {
38
39
s : false ,
39
40
m : true ,
40
41
l : false ,
41
42
} ) ;
42
43
expect ( service . props ( ) . breakpoint ) . toBe ( 'm' ) ;
43
44
45
+ await resizeWindow ( { width : 2048 } ) ;
44
46
useMatchMedia ( '(min-width: 2048px)' ) ;
45
47
expect ( service . props ( ) . activeBreakpoints ) . toEqual ( {
46
48
s : false ,
You can’t perform that action at this time.
0 commit comments