diff --git a/src/progress/__tests__/__snapshots__/index.test.jsx.snap b/src/progress/__tests__/__snapshots__/index.test.jsx.snap index ef4c33f38..c0e1a117d 100644 --- a/src/progress/__tests__/__snapshots__/index.test.jsx.snap +++ b/src/progress/__tests__/__snapshots__/index.test.jsx.snap @@ -373,6 +373,31 @@ exports[`Progress > :props > :status > :status is active 1`] = ` `; +exports[`Progress > :props > :status > :status is active and percentage is 100 1`] = ` +
+
+
+
+
+
+ 100% +
+
+
+`; + exports[`Progress > :props > :status > :status is error 1`] = `
:props > :status > :status is error 1`] = `
`; +exports[`Progress > :props > :status > :status is error and percentage is 100 1`] = ` +
+
+
+
+
+
+ + + +
+
+
+`; + exports[`Progress > :props > :status > :status is success 1`] = `
:props > :status > :status is success 1`] = `
`; +exports[`Progress > :props > :status > :status is success and percentage is 100 1`] = ` +
+
+
+
+
+
+ + + +
+
+
+`; + exports[`Progress > :props > :status > :status is warning 1`] = `
:props > :status > :status is warning 1`] = `
`; +exports[`Progress > :props > :status > :status is warning and percentage is 100 1`] = ` +
+
+
+
+
+
+ + + +
+
+
+`; + exports[`Progress > :props > :strokeWidth > :strokeWidth is Number, equal to 50 1`] = `
{ expect(wrapper.findComponent(Progress).vm.status).toBe(status); expect(wrapper.element).toMatchSnapshot(); }); + + it(`:status is ${status} and percentage is 100`, () => { + const wrapper = mount({ + render() { + return ; + }, + }); + expect(wrapper.findComponent(Progress).vm.percentage).toBe(100); + expect(wrapper.findComponent(Progress).vm.status).toBe(status); + expect(wrapper.element).toMatchSnapshot(); + }); }); }); diff --git a/src/progress/progress.tsx b/src/progress/progress.tsx index 41c2335f5..7b1a02407 100644 --- a/src/progress/progress.tsx +++ b/src/progress/progress.tsx @@ -27,7 +27,7 @@ export default mixins(classPrefixMixins, getGlobalIconMixins()).extend({ computed: { statusStyle(): string { - if (this.percentage >= 100) { + if (!this.status && this.percentage >= 100) { return 'success'; } return this.status;