[new feature] SwipeCell: add name prop (#3680)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user