diff --git a/src/picker/test/cascade.spec.js b/src/picker/test/cascade.spec.js index 5bc60a418..f574626b7 100644 --- a/src/picker/test/cascade.spec.js +++ b/src/picker/test/cascade.spec.js @@ -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']); +});