import { mount } from '@vue/test-utils'; import { VBtn, VTextField } from 'vuetify/components'; import McadDataTable from '@/components/navigation/mcad/McadDataTable.vue'; describe('Opacity tests', () => { it('should mount', () => { const wrapper = mount(McadDataTable); expect(wrapper).toBeTruthy(); }); it('should set value', async () => { const wrapper = mount(McadDataTable); const textfield = wrapper.findComponent(VTextField); await textfield.setValue('100'); expect(wrapper.vm.search).toEqual('100'); }); it('should set value', async () => { const wrapper = mount(McadDataTable); const textfield = wrapper.findComponent(VTextField); await textfield.setValue('100'); expect(wrapper.vm.search).toEqual('100'); const button = wrapper.findComponent(VBtn); await button.trigger('click'); expect(wrapper.vm.search).toEqual(''); }); });