[bugfix] Tabs: incorrect line position in some cases (#3961)

This commit is contained in:
neverland
2019-07-25 19:03:16 +08:00
committed by GitHub
parent f52890cfd6
commit 3c2270a5ad
20 changed files with 154 additions and 168 deletions
@@ -15,7 +15,10 @@ exports[`renders demo correctly 1`] = `
<div class="van-pull-refresh">
<div class="van-pull-refresh__track" style="transition: 0ms;">
<div class="van-pull-refresh__head"></div>
<div role="feed" class="van-list">
<div role="feed" class="van-list" aria-busy="true">
<div class="van-list__loading">
<div class="van-loading van-loading--circular"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201); width: 16px; height: 16px;"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span><span class="van-loading__text">加载中...</span></div>
</div>
<div class="van-list__placeholder"></div>
</div>
</div>
-17
View File
@@ -1,14 +1,6 @@
import List from '..';
import { mount, later, mockGetBoundingClientRect } from '../../../test/utils';
function mockOffsetParent(el) {
Object.defineProperty(el, 'offsetParent', {
get() {
return {};
}
});
}
test('load event', async () => {
const wrapper = mount(List);
@@ -16,8 +8,6 @@ test('load event', async () => {
wrapper.vm.loading = value;
});
mockOffsetParent(wrapper.vm.$el);
await later();
expect(wrapper.emitted('load')).toBeTruthy();
expect(wrapper.emitted('input')).toBeTruthy();
@@ -37,8 +27,6 @@ test('error loaded, click error-text and reload', async () => {
}
});
mockOffsetParent(wrapper.vm.$el);
await later();
expect(wrapper.emitted('load')).toBeFalsy();
@@ -70,8 +58,6 @@ test('finished', async () => {
}
});
mockOffsetParent(wrapper.vm.$el);
await later();
expect(wrapper.emitted('load')).toBeFalsy();
expect(wrapper.emitted('input')).toBeFalsy();
@@ -114,7 +100,6 @@ test('check the case that scroller is not window', async () => {
const listRef = wrapper.find({
ref: 'list'
});
mockOffsetParent(listRef.vm.$el);
await later();
expect(listRef.emitted('load')).toBeTruthy();
@@ -133,8 +118,6 @@ test('check the direction props', async () => {
}
});
mockOffsetParent(wrapper.vm.$el);
await later();
let children = wrapper.findAll('.van-list > div');