feat(Cascader): add className option (#8882)

This commit is contained in:
neverland
2021-06-17 21:11:08 +08:00
committed by GitHub
parent e3341e6c68
commit 5966689ce3
4 changed files with 32 additions and 13 deletions
+13 -1
View File
@@ -104,7 +104,7 @@ test('should render title slot correctly', () => {
// expect(lastSelectedOption.html()).toMatchSnapshot();
// });
test('should reset selected options when value is set to emtpy', async () => {
test('should reset selected options when value is set to empty', async () => {
const wrapper = mount(Cascader, {
props: {
options,
@@ -204,3 +204,15 @@ test('should emit click-tab event when a tab is clicked', async () => {
options[0].children[0].text,
]);
});
test('should allow to custom the className of option', async () => {
const wrapper = mount(Cascader, {
props: {
options: [{ value: '1', text: 'foo', className: 'foo' }],
},
});
await later();
const option = wrapper.find('.van-cascader__option');
expect(option.classes()).toContain('foo');
});