Steps: add test for error step behavior

pull/6282/head
wacky6.AriesMBP 2017-07-06 21:54:28 +08:00 committed by 杨奕
parent 2cd3ef4b6f
commit 11e3181a59
1 changed files with 18 additions and 0 deletions

View File

@ -122,4 +122,22 @@ describe('Steps', () => {
done();
});
});
it('step:status=error', done => {
vm = createVue(`
<el-steps :active="2" process-status="process" finish-status="success" direction="horizontal">
<el-step title="step1"></el-step>
<el-step title="step2" status="error"></el-step>
<el-step title="step3"></el-step>
</el-steps>
`);
vm.$nextTick(_ => {
const errorLine = vm.$el.querySelector('.el-step:nth-child(2) .el-step__line-inner');
expect(errorLine.getBoundingClientRect().width).to.equal(0);
const nextStep = vm.$el.querySelector('.el-step:nth-child(3) .el-step__head');
expect(nextStep.classList.contains('is-wait')).to.equal(true);
done();
});
});
});