[improvement] Cell: functional (#2729)

This commit is contained in:
neverland
2019-02-13 15:37:11 +08:00
committed by GitHub
parent a08666947f
commit 4aad9add9c
19 changed files with 162 additions and 129 deletions
+9 -2
View File
@@ -2,8 +2,15 @@ import Cell from '..';
import { mount } from '../../../test/utils';
test('click event', () => {
const wrapper = mount(Cell);
const click = jest.fn();
const wrapper = mount(Cell, {
context: {
on: {
click
}
}
});
wrapper.trigger('click');
expect(wrapper.emitted('click')).toBeTruthy();
expect(click.mock.calls.length).toBeTruthy();
});