refactor: reorganize all components (#8303)

This commit is contained in:
neverland
2021-03-08 11:50:37 +08:00
committed by GitHub
parent 3144a63d2b
commit e540876398
193 changed files with 1307 additions and 400 deletions
+7 -3
View File
@@ -1,5 +1,5 @@
import { VueWrapper } from '@vue/test-utils';
import ContactEdit, { ContactInfo } from '..';
import ContactEdit, { ContactEditInfo } from '..';
import { mount, later } from '../../../test';
const contactInfo = {
@@ -49,14 +49,18 @@ test('should emit save event after submitting form', async () => {
});
await submitForm(wrapper);
expect(wrapper.emitted<[ContactInfo]>('save')![0][0]).toEqual(contactInfo);
expect(wrapper.emitted<[ContactEditInfo]>('save')![0][0]).toEqual(
contactInfo
);
});
test('should watch contact info', async () => {
const wrapper = mount(ContactEdit);
await wrapper.setProps({ contactInfo });
await submitForm(wrapper);
expect(wrapper.emitted<[ContactInfo]>('save')![0][0]).toEqual(contactInfo);
expect(wrapper.emitted<[ContactEditInfo]>('save')![0][0]).toEqual(
contactInfo
);
});
test('should allow deleting contact', async () => {