diff --git a/src/swipe-cell/README.md b/src/swipe-cell/README.md index e8e975cfe..ab747df02 100644 --- a/src/swipe-cell/README.md +++ b/src/swipe-cell/README.md @@ -13,7 +13,7 @@ Vue.use(SwipeCell); ### Basic Usage ```html - + + + + { expect(wrapper).toMatchSnapshot(); }); -it('on close prop', () => { +it('on-close prop', () => { let position; let instance; @@ -72,6 +72,23 @@ it('on close prop', () => { expect(wrapper.vm.offset).toEqual(0); }); +it('name prop', done => { + const wrapper = mount(SwipeCell, { + ...defaultProps, + propsData: { + ...defaultProps.propsData, + name: 'test', + onClose(position, instance, detail) { + expect(detail.name).toEqual('test'); + done(); + } + } + }); + + wrapper.vm.open('left'); + wrapper.trigger('click'); +}); + it('should reset after drag', () => { const wrapper = mount(SwipeCell, defaultProps);