Skip to content

Commit 20bc096

Browse files
committed
feat: support setting style to wrapper div (test case)
1 parent 873fb98 commit 20bc096

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/specs/lazyload.spec.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('LazyLoad', () => {
4747
expect(document.querySelector('.lazyload-placeholder')).to.exist;
4848
expect(document.querySelector('.treasure')).to.not.exist;
4949
});
50-
50+
5151
it('should NOT update when invisble', (done) => {
5252
ReactDOM.render(
5353
<div>
@@ -145,6 +145,16 @@ describe('LazyLoad', () => {
145145
expect(document.querySelector('.custom-lazyload-wrapper')).to.exist;
146146
expect(document.querySelector('.custom-lazyload-placeholder')).to.exist;
147147
});
148+
it('should render wrapper with `style` when provided', () => {
149+
ReactDOM.render(
150+
<div>
151+
<LazyLoad height={9999} classNamePrefix="custom-lazyload" style={{height: 200}}>
152+
<span>123</span>
153+
</LazyLoad>
154+
</div>, div);
155+
console.log(div.innerHTML);
156+
expect(document.querySelector('.custom-lazyload-wrapper').getBoundingClientRect().height).to.equal(200);
157+
})
148158
});
149159

150160
describe('Checking visibility', () => {

0 commit comments

Comments
 (0)