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() });
1212
1313const {
1414 findRenderedComponentWithType,
15+ findRenderedDOMComponentWithClass,
1516 findRenderedDOMComponentWithTag,
1617 scryRenderedDOMComponentsWithClass,
1718 scryRenderedDOMComponentsWithTag,
@@ -83,6 +84,21 @@ describe('LazyLoadImage', function() {
8384 expect ( loadedWrapper . length ) . toEqual ( 1 ) ;
8485 } ) ;
8586
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+
86102 it ( 'adds the effect class' , function ( ) {
87103 const lazyLoadImage = mount (
88104 < LazyLoadImage effect = "blur" />
You can’t perform that action at this time.
0 commit comments