@@ -11,16 +11,16 @@ describe('media-overlay', () => {
11
11
12
12
// No change when bounds are the same
13
13
updateMediaOverlay ( overlay , { bounds } , { bounds } )
14
- expect ( overlay . setBounds ) . toBeCalledTimes ( 0 )
14
+ expect ( overlay . setBounds ) . toHaveBeenCalledTimes ( 0 )
15
15
16
16
// No change when bounds are not an instance of LatLngBounds
17
17
updateMediaOverlay ( overlay , { bounds : [ ] } , { bounds } )
18
- expect ( overlay . setBounds ) . toBeCalledTimes ( 0 )
18
+ expect ( overlay . setBounds ) . toHaveBeenCalledTimes ( 0 )
19
19
20
20
const newBounds = latLngBounds ( [ 11 , 11 ] , [ 20 , 20 ] )
21
21
updateMediaOverlay ( overlay , { bounds : newBounds } , { bounds } )
22
- expect ( overlay . setBounds ) . toBeCalledTimes ( 1 )
23
- expect ( overlay . setBounds ) . toBeCalledWith ( newBounds )
22
+ expect ( overlay . setBounds ) . toHaveBeenCalledTimes ( 1 )
23
+ expect ( overlay . setBounds ) . toHaveBeenCalledWith ( newBounds )
24
24
} )
25
25
26
26
test ( 'updateMediaOverlay() updates the opacity' , ( ) => {
@@ -31,15 +31,15 @@ describe('media-overlay', () => {
31
31
32
32
// No change when opacity is the same
33
33
updateMediaOverlay ( overlay , { opacity } , { opacity } )
34
- expect ( overlay . setOpacity ) . toBeCalledTimes ( 0 )
34
+ expect ( overlay . setOpacity ) . toHaveBeenCalledTimes ( 0 )
35
35
36
36
// No change when opacity is nullish
37
37
updateMediaOverlay ( overlay , { opacity : undefined } , { opacity } )
38
- expect ( overlay . setOpacity ) . toBeCalledTimes ( 0 )
38
+ expect ( overlay . setOpacity ) . toHaveBeenCalledTimes ( 0 )
39
39
40
40
updateMediaOverlay ( overlay , { opacity : 1 } , { opacity } )
41
- expect ( overlay . setOpacity ) . toBeCalledTimes ( 1 )
42
- expect ( overlay . setOpacity ) . toBeCalledWith ( 1 )
41
+ expect ( overlay . setOpacity ) . toHaveBeenCalledTimes ( 1 )
42
+ expect ( overlay . setOpacity ) . toHaveBeenCalledWith ( 1 )
43
43
} )
44
44
45
45
test ( 'updateMediaOverlay() updates the zIndex' , ( ) => {
@@ -50,14 +50,14 @@ describe('media-overlay', () => {
50
50
51
51
// No change when zIndex is the same
52
52
updateMediaOverlay ( overlay , { zIndex } , { zIndex } )
53
- expect ( overlay . setZIndex ) . toBeCalledTimes ( 0 )
53
+ expect ( overlay . setZIndex ) . toHaveBeenCalledTimes ( 0 )
54
54
55
55
// No change when zIndex is nullish
56
56
updateMediaOverlay ( overlay , { zIndex : null } , { zIndex } )
57
- expect ( overlay . setZIndex ) . toBeCalledTimes ( 0 )
57
+ expect ( overlay . setZIndex ) . toHaveBeenCalledTimes ( 0 )
58
58
59
59
updateMediaOverlay ( overlay , { zIndex : 20 } , { zIndex } )
60
- expect ( overlay . setZIndex ) . toBeCalledTimes ( 1 )
61
- expect ( overlay . setZIndex ) . toBeCalledWith ( 20 )
60
+ expect ( overlay . setZIndex ) . toHaveBeenCalledTimes ( 1 )
61
+ expect ( overlay . setZIndex ) . toHaveBeenCalledWith ( 20 )
62
62
} )
63
63
} )
0 commit comments