chore: demo spec uses ts (#8197)

This commit is contained in:
neverland 2021-02-22 20:53:07 +08:00 committed by GitHub
parent f4698ebf44
commit f0f89f1c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
191 changed files with 254 additions and 256 deletions

View File

@ -1,4 +1,4 @@
import Demo from '../demo'; import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo'; import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo); snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo'; import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo'; import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo); snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo'; import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo'; import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo); snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo'; import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo'; import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo); snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -6,11 +6,11 @@ test('should emit "update:modelValue" event when checkbox icon is clicked', asyn
const icon = wrapper.find('.van-checkbox__icon'); const icon = wrapper.find('.van-checkbox__icon');
icon.trigger('click'); icon.trigger('click');
expect(wrapper.emitted('update:modelValue')[0][0]).toEqual(true); expect(wrapper.emitted<boolean[]>('update:modelValue')[0][0]).toEqual(true);
await wrapper.setProps({ modelValue: true }); await wrapper.setProps({ modelValue: true });
icon.trigger('click'); icon.trigger('click');
expect(wrapper.emitted('update:modelValue')[1][0]).toEqual(false); expect(wrapper.emitted<boolean[]>('update:modelValue')[1][0]).toEqual(false);
}); });
test('should emit change event when modelValue is changed', async () => { test('should emit change event when modelValue is changed', async () => {
@ -19,11 +19,11 @@ test('should emit change event when modelValue is changed', async () => {
const icon = wrapper.find('.van-checkbox__icon'); const icon = wrapper.find('.van-checkbox__icon');
icon.trigger('click'); icon.trigger('click');
await wrapper.setProps({ modelValue: true }); await wrapper.setProps({ modelValue: true });
expect(wrapper.emitted('change')[0][0]).toEqual(true); expect(wrapper.emitted<boolean[]>('change')[0][0]).toEqual(true);
icon.trigger('click'); icon.trigger('click');
await wrapper.setProps({ modelValue: false }); await wrapper.setProps({ modelValue: false });
expect(wrapper.emitted('change')[1][0]).toEqual(false); expect(wrapper.emitted<boolean[]>('change')[1][0]).toEqual(false);
}); });
test('should not emit "update:modelValue" event when checkbox icon is disabled and clicked', () => { test('should not emit "update:modelValue" event when checkbox icon is disabled and clicked', () => {
@ -59,7 +59,7 @@ test('should emit "update:modelValue" event when label is clicked', () => {
const icon = wrapper.find('.van-checkbox__label'); const icon = wrapper.find('.van-checkbox__label');
icon.trigger('click'); icon.trigger('click');
expect(wrapper.emitted('update:modelValue')[0][0]).toEqual(true); expect(wrapper.emitted<boolean[]>('update:modelValue')[0][0]).toEqual(true);
}); });
test('should not emit "update:modelValue" event when label is disabled and clicked', () => { test('should not emit "update:modelValue" event when label is disabled and clicked', () => {

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -1,4 +0,0 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

View File

@ -0,0 +1,4 @@
import Demo from '../demo/index.vue';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);

Some files were not shown because too many files have changed in this diff Show More