fix(List): may trigger load event repeatedly (#4953)

This commit is contained in:
neverland
2019-11-07 17:30:21 +08:00
committed by GitHub
parent 7fc5fb7f5b
commit 0164c33fa5
2 changed files with 49 additions and 23 deletions
+1 -4
View File
@@ -108,7 +108,7 @@ test('check the case that scroller is not window', async () => {
restoreMock();
});
test('check the direction props', async () => {
test('check the direction props', () => {
const wrapper = mount(List, {
slots: {
default: '<div class="list-item">list item</div>'
@@ -118,8 +118,6 @@ test('check the direction props', async () => {
}
});
await later();
let children = wrapper.findAll('.van-list > div');
expect(children.at(0).is('.van-list__placeholder')).toBeTruthy();
expect(children.at(1).is('.list-item')).toBeTruthy();
@@ -129,7 +127,6 @@ test('check the direction props', async () => {
direction: 'down'
});
await later();
children = wrapper.findAll('.van-list > div');
expect(children.at(0).is('.list-item')).toBeTruthy();
expect(children.at(1).is('.van-list__placeholder')).toBeTruthy();