element-ui/test/unit/specs/popconfirm.spec.js

30 lines
670 B
Vue
Raw Normal View History

2021-06-07 11:56:04 +08:00
import { createVue, destroyVM } from '../util';
describe('Popconfirm', () => {
let vm;
afterEach(() => {
destroyVM(vm);
});
describe('trigger', () => {
const createVM = () => {
return createVue(`
<div>
<el-popconfirm
ref="popover"
title="content">
<button slot="reference">trigger</button>
</el-popconfirm>
</div>
`, true);
};
it('click', () => {
vm = createVM();
vm.$el.querySelector('button').click();
document.body.click();
expect(document.body.querySelector('.el-popconfirm__action').style.display).to.equal('');
});
});
});