From f3c76ee0ad340f866aa94b786ea92e48e9469d63 Mon Sep 17 00:00:00 2001 From: luckyCao Date: Mon, 13 Apr 2020 10:15:17 +0800 Subject: [PATCH] Image: Fix shortcut key not work at second time issue (#18983) (#19156) * Image: fix shortcut key not work at second time issue (#18983) * fix test case * fix test case Co-authored-by: cl199793 --- packages/image/src/main.vue | 2 +- test/unit/specs/image.spec.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/image/src/main.vue b/packages/image/src/main.vue index 211fb086b..fa4028dc7 100644 --- a/packages/image/src/main.vue +++ b/packages/image/src/main.vue @@ -16,7 +16,7 @@ :style="imageStyle" :class="{ 'el-image__inner--center': alignCenter, 'el-image__preview': preview }"> diff --git a/test/unit/specs/image.spec.js b/test/unit/specs/image.spec.js index 9ae43b391..cb5f362f9 100644 --- a/test/unit/specs/image.spec.js +++ b/test/unit/specs/image.spec.js @@ -128,11 +128,10 @@ describe('Image', () => { vm.$el.querySelector('.el-image__inner').click(); await wait(); - const $wrapper = vm.$el.querySelector('.el-image-viewer__wrapper'); - expect($wrapper).to.exist; + expect(vm.$el.querySelector('.el-image-viewer__wrapper')).to.exist; vm.$el.querySelector('.el-image-viewer__close').click(); await wait(1000); - expect($wrapper.style.display).to.equal('none'); + expect(vm.$el.querySelector('.el-image-viewer__wrapper')).to.not.exist; }); });