Fix waterfall hide bug (#166)

* fix: waterfall: prevent loadMore after hide

* feat: add waterfall hidden test && remove waterfall auto install

* delete useless code
This commit is contained in:
Yao
2017-09-30 03:41:33 -05:00
committed by GitHub
parent b43b16d04c
commit 367a23ed48
5 changed files with 85 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
import Waterfall from '../components/waterfall/waterfall';
import HiddenWaterfall from '../components/waterfall/waterfall-hide';
import { mount } from 'avoriaz';
describe('Waterfall', () => {
@@ -69,4 +70,22 @@ describe('Waterfall', () => {
done();
}, 500);
});
it('test waterfall function after hide', (done) => {
const waterfallLowerSpy = sinon.spy();
wrapper = mount(HiddenWaterfall, {
attachToDocument: true,
propsData: {
show: false,
disabled: false,
list: [{ id: 10 }],
onWaterfallLower: waterfallLowerSpy
}
});
setTimeout(() => {
expect(waterfallLowerSpy.called).to.be.false;
done();
}, 500);
});
});