feat(Form): support using switch

This commit is contained in:
陈嘉涵
2020-02-10 16:30:17 +08:00
parent 0e23124c3a
commit 1db9536182
6 changed files with 125 additions and 110 deletions
+11 -19
View File
@@ -5,11 +5,9 @@ test('emit event', () => {
const input = jest.fn();
const change = jest.fn();
const wrapper = mount(Switch, {
context: {
on: {
input,
change,
},
listeners: {
input,
change,
},
});
wrapper.trigger('click');
@@ -22,11 +20,9 @@ test('disabled', () => {
const input = jest.fn();
const change = jest.fn();
const wrapper = mount(Switch, {
context: {
on: {
input,
change,
},
listeners: {
input,
change,
},
propsData: {
disabled: true,
@@ -47,11 +43,9 @@ test('active-value & inactive-value prop', () => {
activeValue: '1',
inactiveValue: '2',
},
context: {
on: {
input,
change,
},
listeners: {
input,
change,
},
});
@@ -86,10 +80,8 @@ test('size prop', () => {
test('click event', () => {
const click = jest.fn();
const wrapper = mount(Switch, {
context: {
on: {
click,
},
listeners: {
click,
},
});