feat(Field): add clear-icon prop (#8438)
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should change clear icon when using clear-icon prop 1`] = `
|
||||
<i class="van-badge__wrapper van-icon van-icon-cross van-field__clear">
|
||||
</i>
|
||||
`;
|
||||
|
||||
exports[`should render colon when using colon prop 1`] = `
|
||||
<div class="van-cell__title van-field__label">
|
||||
<span>
|
||||
|
||||
@@ -430,3 +430,17 @@ test('should allow to set autocomplete attribute', () => {
|
||||
'on'
|
||||
);
|
||||
});
|
||||
|
||||
test('should change clear icon when using clear-icon prop', async () => {
|
||||
const wrapper = mount(Field, {
|
||||
props: {
|
||||
clearable: true,
|
||||
clearIcon: 'cross',
|
||||
modelValue: 'test',
|
||||
},
|
||||
});
|
||||
|
||||
const input = wrapper.find('input');
|
||||
await input.trigger('focus');
|
||||
expect(wrapper.find('.van-field__clear').html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user