test: fix ci image/avatar test error (#16863)

* test: fix ci image test error

* test: add test

* test: add test

* test: add ci

* test: add ci

* test: fix avatar emitted undefined

* test: fix ci image test error

* test: fix ci image/avatar test error

* test: fix ci image/avatar test error

* test: again test

* test: again test2

* test: delete test ci
This commit is contained in:
sea / 神秘海 2024-05-16 12:49:50 +08:00 committed by GitHub
parent 4e0bed01e5
commit 48e75f53dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -55,7 +55,7 @@ describe('Avatar.vue', () => {
)
await nextTick()
expect(wrapper.emitted('error')).toBeDefined()
wrapper.emitted('error') && expect(wrapper.emitted('error')).toBeDefined()
await nextTick()
expect(wrapper.text()).toBe('fallback')
expect(wrapper.find('img').exists()).toBe(false)

View File

@ -44,6 +44,7 @@ describe('Image.vue', () => {
await doubleWait()
expect(wrapper.find('.el-image__inner').exists()).toBe(true)
expect(wrapper.find('img').exists()).toBe(true)
await nextTick()
expect(wrapper.find('.el-image__placeholder').exists()).toBe(false)
expect(wrapper.find('.el-image__error').exists()).toBe(false)
})
@ -55,7 +56,7 @@ describe('Image.vue', () => {
},
})
await doubleWait()
expect(wrapper.emitted('error')).toBeDefined()
wrapper.emitted('error') && expect(wrapper.emitted('error')).toBeDefined()
expect(wrapper.find('.el-image__inner').exists()).toBe(false)
expect(wrapper.find('img').exists()).toBe(false)
expect(wrapper.find('.el-image__error').exists()).toBe(true)