[breaking change] Field: renaming icon props、events
This commit is contained in:
@@ -44,17 +44,6 @@ exports[`render label slot 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`render right icon with icon prop for old version 1`] = `
|
||||
<div class="van-cell van-field">
|
||||
<div class="van-cell__value van-cell__value--alone">
|
||||
<div class="van-field__body"><input type="text" class="van-field__control">
|
||||
<div class="van-field__right-icon"><i class="van-icon van-icon-success">
|
||||
<!----></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`render textarea 1`] = `
|
||||
<div class="van-cell van-field">
|
||||
<div class="van-cell__value van-cell__value--alone">
|
||||
|
||||
@@ -11,22 +11,18 @@ test('input event', () => {
|
||||
});
|
||||
|
||||
test('click icon event', () => {
|
||||
const onIconClick = jest.fn();
|
||||
const wrapper = mount(Field, {
|
||||
propsData: {
|
||||
value: 'a',
|
||||
leftIcon: 'contact',
|
||||
rightIcon: 'search',
|
||||
onIconClick
|
||||
rightIcon: 'search'
|
||||
}
|
||||
});
|
||||
|
||||
wrapper.find('.van-field__left-icon').trigger('click');
|
||||
wrapper.find('.van-field__right-icon').trigger('click');
|
||||
expect(wrapper.emitted('click-icon')).toBeTruthy();
|
||||
expect(wrapper.emitted('click-left-icon')).toBeTruthy();
|
||||
expect(wrapper.emitted('click-right-icon')).toBeTruthy();
|
||||
expect(onIconClick).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('keypress event', () => {
|
||||
@@ -179,15 +175,6 @@ test('render label slot', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('render right icon with icon prop for old version', () => {
|
||||
const wrapper = mount(Field, {
|
||||
propsData: {
|
||||
icon: 'success'
|
||||
}
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('size prop', () => {
|
||||
const wrapper = mount(Field, {
|
||||
propsData: {
|
||||
|
||||
Reference in New Issue
Block a user