fix(NumberKeyboard): show-delete-key prop not work (#5935)

This commit is contained in:
neverland
2020-03-28 09:43:33 +08:00
committed by GitHub
parent cd07773e34
commit ac3c77c17f
6 changed files with 47 additions and 13 deletions
+22
View File
@@ -189,3 +189,25 @@ test('maxlength', () => {
expect(wrapper.vm.value).toEqual('1');
expect(onInput).toHaveBeenCalledTimes(1);
});
test('show-delete-key prop', () => {
const wrapper = mount(NumberKeyboard, {
propsData: {
showDeleteKey: true,
},
});
expect(wrapper.contains('.van-key--delete')).toBeTruthy();
wrapper.setData({ showDeleteKey: false });
expect(wrapper.contains('.van-key--delete')).toBeFalsy();
wrapper.setData({
theme: 'custom',
showDeleteKey: true,
});
expect(wrapper.contains('.van-key--delete')).toBeTruthy();
wrapper.setData({ showDeleteKey: false });
expect(wrapper.contains('.van-key--delete')).toBeFalsy();
});