mirror of
https://github.com/youzan/vant.git
synced 2025-12-18 02:06:02 +08:00
[Improvement] Field: add is-link prop (#1347)
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import List from '..';
|
||||
import { mount, later } from '../../../test/utils';
|
||||
|
||||
function mockOffsetParent(el) {
|
||||
Object.defineProperty(el, 'offsetParent', {
|
||||
get() {
|
||||
return {};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
test('load event', async() => {
|
||||
const wrapper = mount(List);
|
||||
|
||||
@@ -8,6 +16,8 @@ test('load event', async() => {
|
||||
wrapper.vm.loading = value;
|
||||
});
|
||||
|
||||
mockOffsetParent(wrapper.vm.$el);
|
||||
|
||||
await later();
|
||||
expect(wrapper.emitted('load')).toBeTruthy();
|
||||
expect(wrapper.emitted('input')).toBeTruthy();
|
||||
@@ -26,6 +36,8 @@ test('finished', async() => {
|
||||
}
|
||||
});
|
||||
|
||||
mockOffsetParent(wrapper.vm.$el);
|
||||
|
||||
await later();
|
||||
expect(wrapper.emitted('load')).toBeFalsy();
|
||||
expect(wrapper.emitted('input')).toBeFalsy();
|
||||
|
||||
Reference in New Issue
Block a user