import Vue from 'vue'; import Grid from '..'; import GridItem from '../../grid-item'; import { mount } from '../../../test/utils'; Vue.use(Grid); Vue.use(GridItem); test('click grid item', () => { const onClick = jest.fn(); const wrapper = mount({ template: ` `, methods: { onClick } }); const Item = wrapper.find('.van-grid-item__content'); Item.trigger('click'); expect(onClick).toHaveBeenCalledTimes(1); }); test('sqaure and set gutter', () => { const wrapper = mount({ template: ` ` }); expect(wrapper).toMatchSnapshot(); });