mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
[bugfix] Checkbox: label-position prop not work
This commit is contained in:
@@ -31,8 +31,8 @@ test('disabled', () => {
|
||||
|
||||
test('label disabled', () => {
|
||||
const wrapper = mount(Checkbox, {
|
||||
slots: {
|
||||
default: '<div />'
|
||||
scopedSlots: {
|
||||
default: () => 'Label'
|
||||
},
|
||||
propsData: {
|
||||
labelDisabled: true
|
||||
@@ -41,6 +41,7 @@ test('label disabled', () => {
|
||||
|
||||
wrapper.find('.van-checkbox__label').trigger('click');
|
||||
expect(wrapper.emitted('input')).toBeFalsy();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('checkbox group', async () => {
|
||||
@@ -91,3 +92,16 @@ test('click event', () => {
|
||||
icon.trigger('click');
|
||||
expect(onClick).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
test('label-position prop', () => {
|
||||
const wrapper = mount(Checkbox, {
|
||||
scopedSlots: {
|
||||
default: () => 'Label'
|
||||
},
|
||||
propsData: {
|
||||
labelPosition: 'left'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user