[new feature] SwipeCell: add name prop (#3680)

This commit is contained in:
neverland
2019-06-28 16:03:10 +08:00
committed by GitHub
parent a6ce44fbb0
commit 08358c89eb
5 changed files with 42 additions and 15 deletions
+18 -1
View File
@@ -36,7 +36,7 @@ it('drag and show right part', () => {
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);