mirror of https://github.com/ElemeFE/element
* Image: fix shortcut key not work at second time issue (#18983) * fix test case * fix test case Co-authored-by: cl199793 <cl199793@alibaba-inc.com>pull/19162/head
parent
3235daa363
commit
f3c76ee0ad
|
@ -16,7 +16,7 @@
|
|||
:style="imageStyle"
|
||||
:class="{ 'el-image__inner--center': alignCenter, 'el-image__preview': preview }">
|
||||
<template v-if="preview">
|
||||
<image-viewer :z-index="zIndex" :initial-index="imageIndex" v-show="showViewer" :on-close="closeViewer" :url-list="previewSrcList"/>
|
||||
<image-viewer :z-index="zIndex" :initial-index="imageIndex" v-if="showViewer" :on-close="closeViewer" :url-list="previewSrcList"/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue