NoticeBar: add test cases

This commit is contained in:
陈嘉涵
2017-08-28 14:20:34 +08:00
parent a1aededecb
commit c357dd4e71
4 changed files with 68 additions and 7 deletions
+3 -3
View File
@@ -7,14 +7,14 @@ const defaultProps = {
leftWidth: 100,
rightWidth: 100
}
}
};
describe('CellSwipe', () => {
let wrapper;
afterEach(() => {
wrapper && wrapper.destroy();
});
it('render left or right part when has width', () => {
wrapper = mount(CellSwipe, defaultProps);
expect(wrapper.find('.van-cell-swipe__left').length).to.equal(1);
@@ -97,7 +97,7 @@ describe('CellSwipe', () => {
triggerTouch(wrapper, 'touchstart', 0, 0);
triggerTouch(wrapper, 'touchmove', 1, 0);
wrapper.vm.$nextTick(() => {
expect(wrapper.vm.offset).to.equal(0);
expect(wrapper.vm.opened).to.be.false;