Merge branch '2.x' into dev
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user