mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(Search): fix spec typing (#8245)
This commit is contained in:
parent
bbb882acfa
commit
29890efedb
@ -1,5 +1,6 @@
|
|||||||
import Search from '..';
|
import Search from '..';
|
||||||
import { mount } from '../../../test';
|
import { mount } from '../../../test';
|
||||||
|
import type { ComponentInstance } from '../../utils';
|
||||||
|
|
||||||
test('should emit update:modelValue event when input value changed', () => {
|
test('should emit update:modelValue event when input value changed', () => {
|
||||||
const onUpdateModelValue = jest.fn();
|
const onUpdateModelValue = jest.fn();
|
||||||
@ -125,7 +126,7 @@ test('should call input.focus when vm.focus is called', () => {
|
|||||||
const onFocus = jest.fn();
|
const onFocus = jest.fn();
|
||||||
wrapper.find('input').element.focus = onFocus;
|
wrapper.find('input').element.focus = onFocus;
|
||||||
|
|
||||||
wrapper.vm.focus();
|
(wrapper.vm as ComponentInstance).focus();
|
||||||
expect(onFocus).toHaveBeenCalledTimes(1);
|
expect(onFocus).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -134,6 +135,6 @@ test('should call input.blur when vm.blur is called', () => {
|
|||||||
const onBlur = jest.fn();
|
const onBlur = jest.fn();
|
||||||
wrapper.find('input').element.blur = onBlur;
|
wrapper.find('input').element.blur = onBlur;
|
||||||
|
|
||||||
wrapper.vm.blur();
|
(wrapper.vm as ComponentInstance).blur();
|
||||||
expect(onBlur).toHaveBeenCalledTimes(1);
|
expect(onBlur).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user