[bugfix] Checkbox: label-position prop not work

This commit is contained in:
陈嘉涵
2019-05-31 21:36:04 +08:00
parent 898ba11483
commit df275a0168
6 changed files with 56 additions and 12 deletions

View File

@@ -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();
});