[improvement] rename packages dir to src (#3659)

This commit is contained in:
neverland
2019-06-27 11:25:57 +08:00
committed by GitHub
parent 8489918dca
commit 75c79b7044
619 changed files with 21 additions and 21 deletions
+51
View File
@@ -0,0 +1,51 @@
import Button from '../../goods-action-button';
import Icon from '../../goods-action-icon';
import { mount } from '../../../test/utils';
test('Button click event', () => {
const click = jest.fn();
const wrapper = mount(Button, {
context: {
on: {
click
}
}
});
wrapper.trigger('click');
expect(click).toHaveBeenCalledTimes(1);
});
test('Icon click event', () => {
const click = jest.fn();
const wrapper = mount(Icon, {
context: {
on: {
click
}
}
});
wrapper.trigger('click');
expect(click).toHaveBeenCalledTimes(1);
});
test('Button render default slot', () => {
const wrapper = mount({
render(h) {
return h(Button, null, ['Default Content']);
}
});
expect(wrapper).toMatchSnapshot();
});
test('Icon render default slot', () => {
const wrapper = mount({
render(h) {
return h(Icon, null, ['Default Content']);
}
});
expect(wrapper).toMatchSnapshot();
});