From aab36469727f451b8e182bf96ee2ed3d4601a0c0 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 1 Apr 2021 10:32:34 +0800 Subject: [PATCH] test(ImagePreview): fix snapshot (#8443) --- .../test/__snapshots__/index.spec.ts.snap | 174 ++++++++---------- src/image-preview/test/index.spec.ts | 4 +- 2 files changed, 74 insertions(+), 104 deletions(-) diff --git a/src/image-preview/test/__snapshots__/index.spec.ts.snap b/src/image-preview/test/__snapshots__/index.spec.ts.snap index 071c28cb6..e5eb9fc83 100644 --- a/src/image-preview/test/__snapshots__/index.spec.ts.snap +++ b/src/image-preview/test/__snapshots__/index.spec.ts.snap @@ -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":
+ - -
- -
- - - - - - - - - - - - - - - - - -
- +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
- -
, - "style": CSSStyleDeclaration { - "0": "transition-duration", - "_importants": Object { - "transition-duration": undefined, - }, - "_length": 1, - "_onChange": [Function], - "_values": Object { - "transition-duration": ".3s", - }, - }, -} +
+
`; exports[`zoom in and drag image to move 2`] = ` -DOMWrapper { - "element":
+ - -
- -
- - - - - - - - - - - - - - - - - -
- +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
- -
, - "style": CSSStyleDeclaration { - "0": "transition-duration", - "_importants": Object { - "transition-duration": undefined, - }, - "_length": 1, - "_onChange": [Function], - "_values": Object { - "transition-duration": ".3s", - }, - }, -} +
+
`; diff --git a/src/image-preview/test/index.spec.ts b/src/image-preview/test/index.spec.ts index 561fad635..fdf2b6a8e 100644 --- a/src/image-preview/test/index.spec.ts +++ b/src/image-preview/test/index.spec.ts @@ -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(); });