[Improvement] Rebuild test system (#1051)

This commit is contained in:
neverland
2018-05-12 14:04:32 +08:00
committed by GitHub
parent 360f2f40b1
commit a55eda8891
185 changed files with 4989 additions and 7950 deletions

View File

@@ -0,0 +1,27 @@
import { mount } from '@vue/test-utils';
import Badge from '../';
import BadgeGroup from '../../badge-group';
import demoTest from '../../../test/demo-test';
demoTest(Badge);
test('click', () => {
const onClick = jest.fn();
const wrapper = mount({
template: `
<badge-group>
<badge @click="onClick">Text</badge>
</badge-group>
`,
components: {
Badge,
BadgeGroup
},
methods: {
onClick
}
});
wrapper.find('.van-badge').trigger('click');
expect(onClick.mock.calls[0][0]).toBe(0);
});