File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ configure({ adapter: new Adapter() });
12
12
13
13
const {
14
14
findRenderedComponentWithType,
15
+ findRenderedDOMComponentWithClass,
15
16
findRenderedDOMComponentWithTag,
16
17
scryRenderedDOMComponentsWithClass,
17
18
scryRenderedDOMComponentsWithTag,
@@ -83,6 +84,21 @@ describe('LazyLoadImage', function() {
83
84
expect ( loadedWrapper . length ) . toEqual ( 1 ) ;
84
85
} ) ;
85
86
87
+ it ( 'resets the background-image and background-size when img triggers onLoad' , function ( ) {
88
+ const lazyLoadImage = mount (
89
+ < LazyLoadImage effect = "blur" />
90
+ ) ;
91
+
92
+ const img = findRenderedDOMComponentWithTag ( lazyLoadImage . instance ( ) , 'img' ) ;
93
+
94
+ Simulate . load ( img ) ;
95
+
96
+ const loadedWrapper = findRenderedDOMComponentWithClass ( lazyLoadImage . instance ( ) , 'lazy-load-image-loaded' ) ;
97
+
98
+ expect ( loadedWrapper . style . getPropertyValue ( 'background-image' ) ) . toEqual ( '' ) ;
99
+ expect ( loadedWrapper . style . getPropertyValue ( 'background-size' ) ) . toEqual ( '' ) ;
100
+ } ) ;
101
+
86
102
it ( 'adds the effect class' , function ( ) {
87
103
const lazyLoadImage = mount (
88
104
< LazyLoadImage effect = "blur" />
You can’t perform that action at this time.
0 commit comments