popconfirm.spec.js 670 B

1234567891011121314151617181920212223242526272829
  1. import { createVue, destroyVM } from '../util';
  2. describe('Popconfirm', () => {
  3. let vm;
  4. afterEach(() => {
  5. destroyVM(vm);
  6. });
  7. describe('trigger', () => {
  8. const createVM = () => {
  9. return createVue(`
  10. <div>
  11. <el-popconfirm
  12. ref="popover"
  13. title="content">
  14. <button slot="reference">trigger</button>
  15. </el-popconfirm>
  16. </div>
  17. `, true);
  18. };
  19. it('click', () => {
  20. vm = createVM();
  21. vm.$el.querySelector('button').click();
  22. document.body.click();
  23. expect(document.body.querySelector('.el-popconfirm__action').style.display).to.equal('');
  24. });
  25. });
  26. });