Commit d6721eed authored by Leopoldthecoder's avatar Leopoldthecoder Committed by cinwell.li

fix some potential test err

parent 821c8554
...@@ -29,7 +29,7 @@ describe('Alert', () => { ...@@ -29,7 +29,7 @@ describe('Alert', () => {
expect(vm.$el.querySelector('.el-alert__description')).to.exist; expect(vm.$el.querySelector('.el-alert__description')).to.exist;
}); });
it('close', done => { it('close', () => {
const vm = createVue({ const vm = createVue({
template: ` template: `
<div> <div>
...@@ -40,9 +40,6 @@ describe('Alert', () => { ...@@ -40,9 +40,6 @@ describe('Alert', () => {
` `
}, true); }, true);
vm.$el.querySelector('.el-alert__closebtn').click(); vm.$el.querySelector('.el-alert__closebtn').click();
setTimeout(() => { expect(vm.$children[0].visible).to.false;
expect(vm.$children[0].$el.style.display).to.equal('none');
done();
}, 300);
}); });
}); });
...@@ -36,7 +36,7 @@ describe('Slider', () => { ...@@ -36,7 +36,7 @@ describe('Slider', () => {
}, 100); }, 100);
}); });
it('show tooltip', () => { it('show tooltip', done => {
const vm = createVue({ const vm = createVue({
template: ` template: `
<div> <div>
...@@ -57,9 +57,8 @@ describe('Slider', () => { ...@@ -57,9 +57,8 @@ describe('Slider', () => {
vm.$nextTick(() => { vm.$nextTick(() => {
expect(popup.style.display).to.not.equal('none'); expect(popup.style.display).to.not.equal('none');
slider.onDragEnd(); slider.onDragEnd();
setTimeout(() => { expect(slider.showTip).to.false;
expect(popup.style.display).to.equal('none'); done();
}, 350);
}); });
}); });
......
...@@ -49,7 +49,7 @@ describe('Switch', () => { ...@@ -49,7 +49,7 @@ describe('Switch', () => {
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.value).to.equal(false); expect(vm.value).to.equal(false);
expect(getComputedStyle(core).backgroundColor).to.equal('rgb(192, 204, 218)'); expect(getComputedStyle(core).backgroundColor).to.equal('rgb(192, 204, 218)');
expect(button.style.transform).to.equal('translate3d(2px, 2px, 0)'); expect(/2px, 2px/.test(button.style.transform)).to.true;
core.click(); core.click();
expect(vm.value).to.equal(true); expect(vm.value).to.equal(true);
done(); done();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment