Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2021-01-02 16:23:31 +08:00
7 changed files with 91 additions and 3 deletions
@@ -51,6 +51,16 @@ exports[`should render demo and match snapshot 1`] = `
<i class="van-badge__wrapper van-icon van-icon-arrow van-cell__right-icon">
</i>
</div>
<div class="van-cell van-cell--clickable"
role="button"
tabindex="0"
>
<div class="van-cell__value van-cell__value--alone">
Show Keyboard With Random Key Order
</div>
<i class="van-badge__wrapper van-icon van-icon-arrow van-cell__right-icon">
</i>
</div>
<div class="van-cell van-cell--clickable van-field"
role="button"
tabindex="0"
+19
View File
@@ -238,3 +238,22 @@ test('close-button-loading prop', () => {
expect(wrapper.contains('.van-key__loading-icon')).toBeTruthy();
});
test('random-key-order prop', () => {
const wrapper = mount(NumberKeyboard, {
propsData: {
show: true,
randomKeyOrder: true,
},
});
const keys = [];
const clickKeys = [];
for (let i = 0; i < 9; i++) {
keys.push(i + 1);
clickKey(wrapper.findAll('.van-key').at(i));
clickKeys.push(wrapper.emitted('input')[i][0]);
}
expect(keys.every((v, k) => keys[k] === clickKeys[k])).toEqual(false);
});