Procházet zdrojové kódy

Steps: add test for error step behavior

wacky6.AriesMBP před 8 roky
rodič
revize
11e3181a59
1 změnil soubory, kde provedl 18 přidání a 0 odebrání
  1. 18 0
      test/unit/specs/steps.spec.js

+ 18 - 0
test/unit/specs/steps.spec.js

@@ -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();
+    });
+  });
 });