mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +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']);
|
||||
});
|
||||
|
||||
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', () => {
|
||||
const wrapper = mount(Picker, {
|
||||
propsData: {
|
||||
@ -82,3 +95,16 @@ test('setColumnIndex of cascade columns', () => {
|
||||
wrapper.find('.van-picker__confirm').trigger('click');
|
||||
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