mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
test(Picker): add test cases of cascade
This commit is contained in:
parent
68f5d3d69b
commit
1b965be25e
@ -66,6 +66,19 @@ test('setColumnValue of cascade columns', () => {
|
|||||||
expect(wrapper.emitted('confirm')[1][0]).toEqual(['A2', 'B4', 'C7']);
|
expect(wrapper.emitted('confirm')[1][0]).toEqual(['A2', 'B4', 'C7']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('setValues of cascade columns', () => {
|
||||||
|
const wrapper = mount(Picker, {
|
||||||
|
propsData: {
|
||||||
|
showToolbar: true,
|
||||||
|
columns: COLUMNS,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
wrapper.vm.setValues(['A2', 'B4', 'C8']);
|
||||||
|
wrapper.find('.van-picker__confirm').trigger('click');
|
||||||
|
expect(wrapper.emitted('confirm')[0][0]).toEqual(['A2', 'B4', 'C8']);
|
||||||
|
});
|
||||||
|
|
||||||
test('setColumnIndex of cascade columns', () => {
|
test('setColumnIndex of cascade columns', () => {
|
||||||
const wrapper = mount(Picker, {
|
const wrapper = mount(Picker, {
|
||||||
propsData: {
|
propsData: {
|
||||||
@ -82,3 +95,16 @@ test('setColumnIndex of cascade columns', () => {
|
|||||||
wrapper.find('.van-picker__confirm').trigger('click');
|
wrapper.find('.van-picker__confirm').trigger('click');
|
||||||
expect(wrapper.emitted('confirm')[1][0]).toEqual(['A2', 'B4', 'C7']);
|
expect(wrapper.emitted('confirm')[1][0]).toEqual(['A2', 'B4', 'C7']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('setIndexes of cascade columns', () => {
|
||||||
|
const wrapper = mount(Picker, {
|
||||||
|
propsData: {
|
||||||
|
showToolbar: true,
|
||||||
|
columns: COLUMNS,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
wrapper.vm.setIndexes([1, 0, 1]);
|
||||||
|
wrapper.find('.van-picker__confirm').trigger('click');
|
||||||
|
expect(wrapper.emitted('confirm')[0][0]).toEqual(['A2', 'B3', 'C6']);
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user