[new feature] Tag: add click event (#2693)

This commit is contained in:
neverland
2019-02-06 20:44:40 +08:00
committed by GitHub
parent 9c5e5b8158
commit 305dc19ceb
3 changed files with 28 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import Tag from '..';
import { mount } from '../../../test/utils';
test('click event', () => {
const click = jest.fn();
const wrapper = mount(Tag, {
context: {
on: {
click
}
}
});
wrapper.trigger('click');
expect(click.mock.calls.length).toEqual(1);
});