feat(Cascader): add close-icon prop (#8334)

This commit is contained in:
neverland
2021-03-14 11:20:08 +08:00
committed by GitHub
parent 393d7cb7af
commit c424d6efcd
6 changed files with 26 additions and 2 deletions
@@ -1,5 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should change close icon when using close-icon prop 1`] = `
<i class="van-badge__wrapper van-icon van-icon-success van-cascader__close-icon">
</i>
`;
exports[`should render title slot correctly 1`] = `
<h2 class="van-cascader__title">
Custom Title
+9
View File
@@ -70,6 +70,15 @@ test('should not render close icon when closeable is false', () => {
expect(wrapper.find('.van-cascader__close-icon').exists()).toBeFalsy();
});
test('should change close icon when using close-icon prop', () => {
const wrapper = mount(Cascader, {
props: {
closeIcon: 'success',
},
});
expect(wrapper.find('.van-cascader__close-icon').html()).toMatchSnapshot();
});
test('should render title slot correctly', () => {
const wrapper = mount(Cascader, {
slots: {