mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
f3d24d6109
* fix(popper): fix popper related style * fix(popper): restore `onMount` hook, rewrite `Teleport` usage * fix(popper): fix failed tests due to change * fix(popper): - Fix popper initialiation method * fix(popper): - Replace unref with internal defined unwrap function
28 lines
697 B
TypeScript
28 lines
697 B
TypeScript
import { h } from 'vue'
|
|
import { mount } from '@vue/test-utils'
|
|
import ElPopconfirm from '../src/index.vue'
|
|
const selector = '.el-popper'
|
|
const _mount = (props: any = {}) => mount(ElPopconfirm, {
|
|
props,
|
|
slots: {
|
|
reference: () => h('div', {
|
|
class: 'reference',
|
|
}),
|
|
},
|
|
attachTo: 'body',
|
|
})
|
|
|
|
describe('Popconfirm.vue', () => {
|
|
|
|
test('render test', async () => {
|
|
const wrapper = _mount()
|
|
const trigger = wrapper.find('.reference')
|
|
|
|
expect(document.querySelector(selector).getAttribute('style')).toContain('display: none')
|
|
|
|
await trigger.trigger('click')
|
|
|
|
expect(document.querySelector(selector).getAttribute('style')).not.toContain('display: none')
|
|
})
|
|
})
|