Skip to content

Commit 831cb7c

Browse files
qinwenchengkagol
authored andcommitted
test(input-number): 新增对focus/blur/select方法的测试
1 parent 323a693 commit 831cb7c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/devui-vue/devui/input-number/__tests__/input-number.spec.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,20 @@ describe('d-input-number', () => {
211211
});
212212

213213
it.todo('method focus/blur/select work well.');
214+
it('method focus/blur/select work', async () => {
215+
const blurCallback = jest.fn();
216+
const focusCallback = jest.fn();
217+
const num = ref(0);
218+
const ttt = ref();
219+
const wrapper = mount({
220+
setup() {
221+
return () => <DInputNumber v-model={num.value} onBlur={blurCallback} onFocus={focusCallback} ref={ttt} />;
222+
},
223+
});
224+
const inputNumber = wrapper.find(ns.b());
225+
expect(inputNumber.exists()).toBeTruthy();
226+
227+
const tttt = wrapper.vm.$refs;
228+
console.log(wrapper.vm.$.exposed);
229+
});
214230
});

0 commit comments

Comments
 (0)