chore: add trailingComma
This commit is contained in:
@@ -15,12 +15,12 @@ function triggerZoom(el, x, y) {
|
||||
const images = [
|
||||
'https://img.yzcdn.cn/1.png',
|
||||
'https://img.yzcdn.cn/2.png',
|
||||
'https://img.yzcdn.cn/3.png'
|
||||
'https://img.yzcdn.cn/3.png',
|
||||
];
|
||||
|
||||
test('render image', async () => {
|
||||
const wrapper = mount(ImagePreviewVue, {
|
||||
propsData: { images, value: true }
|
||||
propsData: { images, value: true },
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -43,13 +43,13 @@ test('async close prop', async () => {
|
||||
propsData: {
|
||||
images,
|
||||
value: true,
|
||||
asyncClose: true
|
||||
asyncClose: true,
|
||||
},
|
||||
listeners: {
|
||||
input(value) {
|
||||
wrapper.setProps({ value });
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const swipe = wrapper.find('.van-swipe__track');
|
||||
@@ -99,7 +99,7 @@ test('onClose option', () => {
|
||||
const instance = ImagePreview({
|
||||
images,
|
||||
startPostion: 1,
|
||||
onClose
|
||||
onClose,
|
||||
});
|
||||
|
||||
instance.close();
|
||||
@@ -115,7 +115,7 @@ test('onChange option', async done => {
|
||||
onChange(index) {
|
||||
expect(index).toEqual(2);
|
||||
done();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const swipe = instance.$el.querySelector('.van-swipe__track');
|
||||
@@ -132,7 +132,7 @@ test('zoom', async () => {
|
||||
Element.prototype.getBoundingClientRect = jest.fn(() => ({ width: 100 }));
|
||||
|
||||
const wrapper = mount(ImagePreviewVue, {
|
||||
propsData: { images, value: true }
|
||||
propsData: { images, value: true },
|
||||
});
|
||||
|
||||
const image = wrapper.find('img');
|
||||
@@ -146,8 +146,8 @@ test('set show-index prop to false', () => {
|
||||
const wrapper = mount(ImagePreviewVue, {
|
||||
propsData: {
|
||||
value: true,
|
||||
showIndex: false
|
||||
}
|
||||
showIndex: false,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -159,7 +159,7 @@ test('index slot', () => {
|
||||
<van-image-preview :value="true">
|
||||
<template #index>Custom Index</template>
|
||||
</van-image-preview>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -171,7 +171,7 @@ test('cover slot', () => {
|
||||
<van-image-preview :value="true">
|
||||
<template #cover>Custom Cover Content</template>
|
||||
</van-image-preview>
|
||||
`
|
||||
`,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -182,8 +182,8 @@ test('closeOnPopstate', () => {
|
||||
propsData: {
|
||||
images,
|
||||
value: true,
|
||||
closeOnPopstate: true
|
||||
}
|
||||
closeOnPopstate: true,
|
||||
},
|
||||
});
|
||||
|
||||
trigger(window, 'popstate');
|
||||
@@ -191,7 +191,7 @@ test('closeOnPopstate', () => {
|
||||
|
||||
wrapper.setProps({
|
||||
value: true,
|
||||
closeOnPopstate: false
|
||||
closeOnPopstate: false,
|
||||
});
|
||||
|
||||
trigger(window, 'popstate');
|
||||
@@ -202,12 +202,12 @@ test('lazy-load prop', () => {
|
||||
const wrapper = mount(ImagePreviewVue, {
|
||||
propsData: {
|
||||
images,
|
||||
lazyLoad: true
|
||||
}
|
||||
lazyLoad: true,
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.setProps({
|
||||
value: true
|
||||
value: true,
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
Reference in New Issue
Block a user