import { mount, later } from '../../../test'; // this case will throw wierd error in index.spec.js // so separate it test('insert tab dynamically', async () => { const wrapper = mount({ template: ` 1
2
3
`, data() { return { insert: false, active: 1, }; }, }); await later(); wrapper.setData({ insert: true }); expect(wrapper).toMatchSnapshot(); }); test('insert tab with name dynamically', async () => { const onChange = jest.fn(); const wrapper = mount({ template: ` 2 1 `, data() { return { insert: false, active: 'foo', }; }, methods: { onChange, }, }); await later(); wrapper.setData({ insert: true }); expect(wrapper).toMatchSnapshot(); expect(onChange).toHaveBeenCalledTimes(0); }); // this case will throw wierd error in index.spec.js // so separate it test('insert tab with child component', async () => { const wrapper = mount({ template: ` 1 3 `, components: { 'my-tab': { template: `2`, }, }, }); await later(); expect(wrapper).toMatchSnapshot(); });