test: add typing for some test cases (#8243)

This commit is contained in:
neverland
2021-03-02 09:33:08 +08:00
committed by GitHub
parent 569d353b4a
commit bbb882acfa
13 changed files with 50 additions and 44 deletions

View File

@@ -28,8 +28,8 @@ test('should emit cancel event when cancel button click is clicked', () => {
const cancel = wrapper.find('.van-search__action');
cancel.trigger('click');
expect(wrapper.emitted('cancel').length).toEqual(1);
expect(wrapper.emitted('update:modelValue')[0][0]).toEqual('');
expect(wrapper.emitted('cancel')!.length).toEqual(1);
expect(wrapper.emitted('update:modelValue')![0]).toEqual(['']);
});
test('should not emit cancel event when using action slot', () => {
@@ -56,7 +56,7 @@ test('should emit search event when enter key is pressed', () => {
input.trigger('keypress.enter');
input.trigger('keypress.a');
expect(wrapper.emitted('search').length).toEqual(1);
expect(wrapper.emitted('search')!.length).toEqual(1);
});
test('should render label slot correctly', () => {