diff --git a/packages/image/src/main.vue b/packages/image/src/main.vue index 211fb086b15..fa4028dc7ee 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 9ae43b39191..cb5f362f9b2 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; }); });