mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
test(ImagePreview): fix snapshot (#8443)
This commit is contained in:
parent
96ae24496e
commit
aab3646972
@ -76,113 +76,83 @@ exports[`should swipe to currect index after calling the swipeTo method 1`] = `
|
||||
`;
|
||||
|
||||
exports[`zoom in and drag image to move 1`] = `
|
||||
DOMWrapper {
|
||||
"element": <div
|
||||
class="van-image van-image-preview__image"
|
||||
style="transition-duration: .3s;"
|
||||
<div class="van-image van-image-preview__image"
|
||||
style="transition-duration: .3s;"
|
||||
>
|
||||
<img src="https://img.yzcdn.cn/1.png"
|
||||
class="van-image__img"
|
||||
style="object-fit: contain;"
|
||||
>
|
||||
<img
|
||||
class="van-image__img"
|
||||
src="https://img.yzcdn.cn/1.png"
|
||||
style="object-fit: contain;"
|
||||
/>
|
||||
<div
|
||||
class="van-image__loading"
|
||||
>
|
||||
|
||||
<div
|
||||
class="van-loading van-loading--spinner"
|
||||
>
|
||||
<span
|
||||
class="van-loading__spinner van-loading__spinner--spinner"
|
||||
>
|
||||
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
|
||||
</span>
|
||||
<!---->
|
||||
</div>
|
||||
|
||||
<div class="van-image__loading">
|
||||
<div class="van-loading van-loading--spinner">
|
||||
<span class="van-loading__spinner van-loading__spinner--spinner">
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
<!---->
|
||||
</div>,
|
||||
"style": CSSStyleDeclaration {
|
||||
"0": "transition-duration",
|
||||
"_importants": Object {
|
||||
"transition-duration": undefined,
|
||||
},
|
||||
"_length": 1,
|
||||
"_onChange": [Function],
|
||||
"_values": Object {
|
||||
"transition-duration": ".3s",
|
||||
},
|
||||
},
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`zoom in and drag image to move 2`] = `
|
||||
DOMWrapper {
|
||||
"element": <div
|
||||
class="van-image van-image-preview__image"
|
||||
style="transition-duration: .3s;"
|
||||
<div class="van-image van-image-preview__image"
|
||||
style="transition-duration: .3s;"
|
||||
>
|
||||
<img src="https://img.yzcdn.cn/1.png"
|
||||
class="van-image__img"
|
||||
style="object-fit: contain;"
|
||||
>
|
||||
<img
|
||||
class="van-image__img"
|
||||
src="https://img.yzcdn.cn/1.png"
|
||||
style="object-fit: contain;"
|
||||
/>
|
||||
<div
|
||||
class="van-image__loading"
|
||||
>
|
||||
|
||||
<div
|
||||
class="van-loading van-loading--spinner"
|
||||
>
|
||||
<span
|
||||
class="van-loading__spinner van-loading__spinner--spinner"
|
||||
>
|
||||
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
<i />
|
||||
|
||||
</span>
|
||||
<!---->
|
||||
</div>
|
||||
|
||||
<div class="van-image__loading">
|
||||
<div class="van-loading van-loading--spinner">
|
||||
<span class="van-loading__spinner van-loading__spinner--spinner">
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
<i>
|
||||
</i>
|
||||
</span>
|
||||
</div>
|
||||
<!---->
|
||||
</div>,
|
||||
"style": CSSStyleDeclaration {
|
||||
"0": "transition-duration",
|
||||
"_importants": Object {
|
||||
"transition-duration": undefined,
|
||||
},
|
||||
"_length": 1,
|
||||
"_onChange": [Function],
|
||||
"_values": Object {
|
||||
"transition-duration": ".3s",
|
||||
},
|
||||
},
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
@ -328,12 +328,12 @@ test('zoom in and drag image to move', async () => {
|
||||
|
||||
// drag image before load
|
||||
triggerDrag(image, 300, 300);
|
||||
expect(wrapper.find('.van-image')).toMatchSnapshot();
|
||||
expect(wrapper.find('.van-image').html()).toMatchSnapshot();
|
||||
|
||||
// drag image after load
|
||||
image.trigger('load');
|
||||
triggerDrag(image, 300, 300);
|
||||
expect(wrapper.find('.van-image')).toMatchSnapshot();
|
||||
expect(wrapper.find('.van-image').html()).toMatchSnapshot();
|
||||
|
||||
restore();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user