Repository: Tencent/tdesign-mobile-vue (ts)

Issue:
【Progress】测试覆盖率提升
> 目前正在推进 mobile-vue 的组件测试覆盖率提升。

## 任务要求
- **行覆盖率达 80%+**
- **分支覆盖率 80%+**
- **语句覆盖率 80%+**
- 有交互的组件，需要覆盖所有场景，**要求函数覆盖率 80+%**

## 单元测试指引
 [mobile-vue 的单元测试指引文档](https://github.com/Tencent/tdesign-mobile-vue/wiki/mobile-vue%EF%BC%9A%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E6%8C%87%E5%BC%95)

> **目前每个组件都拥有自己的测试用例文件，我们可以先通过`npm run test:unit-coverage`生成测试覆盖率报告，查看该组件的单元测试覆盖率情况，然后针对性的补充测试用例**

#### Tips
- Vitest 单元测试框架：[文档](https://cn.vitest.dev/guide/)
- 若开发工具为 vscode ，可以安装 Vitest 插件

## 激励

参与共建的开发者，将可以获得 [TDesign 周边](https://github.com/Tencent/tdesign/wiki/TDesign-%E5%91%A8%E8%BE%B9)（贴纸、鼠标垫、工卡套等）；

成为核心贡献者，将会拥有 TDesign 专属头像。

## IssueShoot
- 预估时长: 1
- 期望完成时间: 2023-05-29 00:00:00 +0000 UTC
- 开发难度: 低
- 参与人数: 1
- 验收标准: 实现期望改造效果，提 PR 并通过验收无误
- 备注: 最终激励以实际提交 `pull request` 并合并为准

Pull request:
test(Progress): add test case
<!--
首先，感谢你的贡献！😄
请阅读并遵循 [TDesign 贡献指南](https://github.com/Tencent/tdesign/blob/main/docs/contributing.md)，填写以下 pull request 的信息。
PR 在维护者审核通过后会合并，谢谢！
-->

### 🤔 这个 PR 的性质是？

- [ ] 日常 bug 修复
- [ ] 新特性提交
- [ ] 文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] CI/CD 改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 其他

### 🔗 相关 Issue
fix #721

### 相关PR
common: https://github.com/Tencent/tdesign-common/pull/1359
<!--
1. 描述相关需求的来源，如相关的 issue 讨论链接。
-->

### 💡 需求背景和解决方案

<!--
1. 要解决的具体问题。
2. 列出最终的 API 实现和用法。
3. 涉及UI/交互变动需要有截图或 GIF。
-->

### 📝 更新日志

<!--
从用户角度描述具体变化，以及可能的 breaking change 和其他风险。
-->

- other(Progress): 补充测试用例

- [ ] 本条 PR 不需要纳入 Changelog

### ☑️ 请求合并前的自查清单

⚠️ 请自检并全部**勾选全部选项**。⚠️

- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供
- [ ] TypeScript 定义已补充或无须补充
- [ ] Changelog 已提供或无须提供


Patch:
diff --git a/src/_common b/src/_common
index 69c4ee07..a53b3999 160000
--- a/src/_common
+++ b/src/_common
@@ -1,1 +1,1 @@
-Subproject commit 69c4ee07d0bb127201c9eb7677bd74c6aef2fdf5
+Subproject commit a53b3999b000bc12d196be1f5caf3c1b56e4ddfa
diff --git a/src/progress/constants.ts b/src/progress/constants.ts
index 1adee035..9ffc30bf 100644
--- a/src/progress/constants.ts
+++ b/src/progress/constants.ts
@@ -3,23 +3,17 @@ export const PRO_THEME = {
   PLUMP: 'plump',
   CIRCLE: 'circle',
 };
-export const CIRCLE_SIZE = {
-  SMALL: 'small',
-  MEDIUM: 'medium',
-  LARGE: 'large',
-};
+
 export const CIRCLE_SIZE_PX = 112;
 
-export const STATUS_TEXT = ['success', 'error', 'warning', 'active', 'normal'];
 export const STATUS_ICON = ['success', 'error', 'warning'];
 
+// 进度大于 10 ，进度百分比显示在内部；进度百分比小于 10 进度显示在外部
+export const PLUMP_SEPARATE = 10;
+
 export default {
   PRO_THEME,
-  CIRCLE_SIZE,
   CIRCLE_SIZE_PX,
-  STATUS_TEXT,
   STATUS_ICON,
+  PLUMP_SEPARATE,
 };
-
-// 进度大于 10 ，进度百分比显示在内部；进度百分比小于 10 进度显示在外部
-export const PLUMP_SEPARATE = 10;
diff --git a/src/progress/progress.vue b/src/progress/progress.vue
index 40d81ddf..33189456 100644
--- a/src/progress/progress.vue
+++ b/src/progress/progress.vue
@@ -1,7 +1,7 @@
 <template>
   <div :class="`${name}`">
     <!-- LINE -->
-    <div v-if="theme === PRO_THEME.LINE" :class="[`${name}--thin`, `${name}--status--${computedStatus}`]">
+    <div v-if="theme === PRO_THEME.LINE" :class="[`${name}--thin`, `${name}--status-${computedStatus}`]">
       <div :class="`${name}__bar`" :style="trackBgStyle">
         <div :class="`${name}__inner`" :style="barStyle"></div>
       </div>
@@ -16,7 +16,7 @@
         `${name}__bar`,
         `${name}--plump`,
         `${Number(percentage) > PLUMP_SEPARATE ? name + '--over-ten' : name + '--under-ten'}`,
-        `${name}--status--${computedStatus}`,
+        `${name}--status-${computedStatus}`,
       ]"
       :style="trackBgStyle"
     >
@@ -32,7 +32,7 @@
     <!-- CIRCLE -->
     <div
       v-if="theme === PRO_THEME.CIRCLE"
-      :class="[`${name}--circle`, `${name}--status--${computedStatus}`]"
+      :class="[`${name}--circle`, `${name}--status-${computedStatus}`]"
       :style="circleStyle"
     >
       <div v-if="label" :class="`${name}__info`">


Test patch:
diff --git a/src/progress/__test__/__snapshots__/demo.test.jsx.snap b/src/progress/__test__/__snapshots__/demo.test.jsx.snap
index 27e5a286..49f6937f 100644
--- a/src/progress/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/progress/__test__/__snapshots__/demo.test.jsx.snap
@@ -15,7 +15,7 @@ exports[`Progress > Progress baseVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--default"
+        class="t-progress--thin t-progress--status-default"
       >
         <div
           class="t-progress__bar"
@@ -49,7 +49,7 @@ exports[`Progress > Progress baseVue demo works fine 1`] = `
       <!--v-if-->
       <!-- PLUMP -->
       <div
-        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--default"
+        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-default"
       >
         <div
           class="t-progress__inner"
@@ -81,7 +81,7 @@ exports[`Progress > Progress baseVue demo works fine 1`] = `
       <!--v-if-->
       <!-- CIRCLE -->
       <div
-        class="t-progress--circle t-progress--status--default"
+        class="t-progress--circle t-progress--status-default"
         style="width: 112px; height: 112px;"
       >
         <div
@@ -139,7 +139,7 @@ exports[`Progress > Progress circleVue demo works fine 1`] = `
       <!--v-if-->
       <!-- CIRCLE -->
       <div
-        class="t-progress--circle t-progress--status--default"
+        class="t-progress--circle t-progress--status-default"
         style="width: 112px; height: 112px;"
       >
         <div
@@ -189,7 +189,7 @@ exports[`Progress > Progress circleVue demo works fine 1`] = `
       <!--v-if-->
       <!-- CIRCLE -->
       <div
-        class="t-progress--circle t-progress--status--warning"
+        class="t-progress--circle t-progress--status-warning"
         style="width: 112px; height: 112px;"
       >
         <div
@@ -251,7 +251,7 @@ exports[`Progress > Progress circleVue demo works fine 1`] = `
       <!--v-if-->
       <!-- CIRCLE -->
       <div
-        class="t-progress--circle t-progress--status--error"
+        class="t-progress--circle t-progress--status-error"
         style="width: 112px; height: 112px;"
       >
         <div
@@ -313,7 +313,7 @@ exports[`Progress > Progress circleVue demo works fine 1`] = `
       <!--v-if-->
       <!-- CIRCLE -->
       <div
-        class="t-progress--circle t-progress--status--success"
+        class="t-progress--circle t-progress--status-success"
         style="width: 112px; height: 112px;"
       >
         <div
@@ -379,7 +379,7 @@ exports[`Progress > Progress customVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--default"
+        class="t-progress--thin t-progress--status-default"
       >
         <div
           class="t-progress__bar"
@@ -419,7 +419,7 @@ exports[`Progress > Progress customVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--default"
+        class="t-progress--thin t-progress--status-default"
       >
         <div
           class="t-progress__bar"
@@ -459,7 +459,7 @@ exports[`Progress > Progress lineVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--default"
+        class="t-progress--thin t-progress--status-default"
       >
         <div
           class="t-progress__bar"
@@ -491,7 +491,7 @@ exports[`Progress > Progress lineVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--warning"
+        class="t-progress--thin t-progress--status-warning"
       >
         <div
           class="t-progress__bar"
@@ -535,7 +535,7 @@ exports[`Progress > Progress lineVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--error"
+        class="t-progress--thin t-progress--status-error"
       >
         <div
           class="t-progress__bar"
@@ -579,7 +579,7 @@ exports[`Progress > Progress lineVue demo works fine 1`] = `
     >
       <!-- LINE -->
       <div
-        class="t-progress--thin t-progress--status--success"
+        class="t-progress--thin t-progress--status-success"
       >
         <div
           class="t-progress__bar"
@@ -670,7 +670,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--default"
+              class="t-progress--thin t-progress--status-default"
             >
               <div
                 class="t-progress__bar"
@@ -704,7 +704,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- PLUMP -->
             <div
-              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--default"
+              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-default"
             >
               <div
                 class="t-progress__inner"
@@ -736,7 +736,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- CIRCLE -->
             <div
-              class="t-progress--circle t-progress--status--default"
+              class="t-progress--circle t-progress--status-default"
               style="width: 112px; height: 112px;"
             >
               <div
@@ -805,7 +805,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
         >
           <!-- LINE -->
           <div
-            class="t-progress--thin t-progress--status--default"
+            class="t-progress--thin t-progress--status-default"
           >
             <div
               class="t-progress__bar"
@@ -906,7 +906,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--default"
+              class="t-progress--thin t-progress--status-default"
             >
               <div
                 class="t-progress__bar"
@@ -946,7 +946,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--default"
+              class="t-progress--thin t-progress--status-default"
             >
               <div
                 class="t-progress__bar"
@@ -1009,7 +1009,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--default"
+              class="t-progress--thin t-progress--status-default"
             >
               <div
                 class="t-progress__bar"
@@ -1041,7 +1041,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--warning"
+              class="t-progress--thin t-progress--status-warning"
             >
               <div
                 class="t-progress__bar"
@@ -1085,7 +1085,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--error"
+              class="t-progress--thin t-progress--status-error"
             >
               <div
                 class="t-progress__bar"
@@ -1129,7 +1129,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
           >
             <!-- LINE -->
             <div
-              class="t-progress--thin t-progress--status--success"
+              class="t-progress--thin t-progress--status-success"
             >
               <div
                 class="t-progress__bar"
@@ -1202,7 +1202,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- PLUMP -->
             <div
-              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--default"
+              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-default"
             >
               <div
                 class="t-progress__inner"
@@ -1232,7 +1232,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- PLUMP -->
             <div
-              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--warning"
+              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-warning"
             >
               <div
                 class="t-progress__inner"
@@ -1262,7 +1262,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- PLUMP -->
             <div
-              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--error"
+              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-error"
             >
               <div
                 class="t-progress__inner"
@@ -1292,7 +1292,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- PLUMP -->
             <div
-              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--success"
+              class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-success"
             >
               <div
                 class="t-progress__inner"
@@ -1351,7 +1351,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- CIRCLE -->
             <div
-              class="t-progress--circle t-progress--status--default"
+              class="t-progress--circle t-progress--status-default"
               style="width: 112px; height: 112px;"
             >
               <div
@@ -1401,7 +1401,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- CIRCLE -->
             <div
-              class="t-progress--circle t-progress--status--warning"
+              class="t-progress--circle t-progress--status-warning"
               style="width: 112px; height: 112px;"
             >
               <div
@@ -1463,7 +1463,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- CIRCLE -->
             <div
-              class="t-progress--circle t-progress--status--error"
+              class="t-progress--circle t-progress--status-error"
               style="width: 112px; height: 112px;"
             >
               <div
@@ -1525,7 +1525,7 @@ exports[`Progress > Progress mobileVue demo works fine 1`] = `
             <!--v-if-->
             <!-- CIRCLE -->
             <div
-              class="t-progress--circle t-progress--status--success"
+              class="t-progress--circle t-progress--status-success"
               style="width: 112px; height: 112px;"
             >
               <div
@@ -1597,7 +1597,7 @@ exports[`Progress > Progress plumpVue demo works fine 1`] = `
       <!--v-if-->
       <!-- PLUMP -->
       <div
-        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--default"
+        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-default"
       >
         <div
           class="t-progress__inner"
@@ -1627,7 +1627,7 @@ exports[`Progress > Progress plumpVue demo works fine 1`] = `
       <!--v-if-->
       <!-- PLUMP -->
       <div
-        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--warning"
+        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-warning"
       >
         <div
           class="t-progress__inner"
@@ -1657,7 +1657,7 @@ exports[`Progress > Progress plumpVue demo works fine 1`] = `
       <!--v-if-->
       <!-- PLUMP -->
       <div
-        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--error"
+        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-error"
       >
         <div
           class="t-progress__inner"
@@ -1687,7 +1687,7 @@ exports[`Progress > Progress plumpVue demo works fine 1`] = `
       <!--v-if-->
       <!-- PLUMP -->
       <div
-        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status--success"
+        class="t-progress__bar t-progress--plump t-progress--over-ten t-progress--status-success"
       >
         <div
           class="t-progress__inner"
@@ -1719,7 +1719,7 @@ exports[`Progress > Progress transitionVue demo works fine 1`] = `
   >
     <!-- LINE -->
     <div
-      class="t-progress--thin t-progress--status--default"
+      class="t-progress--thin t-progress--status-default"
     >
       <div
         class="t-progress__bar"
diff --git a/src/progress/__test__/index.test.jsx b/src/progress/__test__/index.test.jsx
index 9cf77f2f..5de2f6f7 100644
--- a/src/progress/__test__/index.test.jsx
+++ b/src/progress/__test__/index.test.jsx
@@ -58,11 +58,13 @@ describe('Progress', () => {
     });
 
     it(': status', async () => {
-      const wrapper = mount(Progress, {
-        props: { status: 'success' },
+      const statusList = ['', 'success', 'error', 'warning', 'active'];
+      const statusListResult = ['default', 'success', 'error', 'warning', 'active'];
+      statusList.forEach((status, index) => {
+        const wrapper = mount(() => <Progress percentage={30} status={status} />);
+        const thin = wrapper.find('.t-progress--thin');
+        expect(thin.classes()).toContain(`t-progress--status-${statusListResult[index]}`);
       });
-      const container = wrapper.find('.t-progress--thin');
-      expect(container.classes()).toContain('t-progress--status--success');
     });
 
     it(': strokeWidth', async () => {
@@ -86,6 +88,20 @@ describe('Progress', () => {
       });
       expect(getComputedStyle(wrapper.find('.t-progress__bar').element).backgroundColor).toEqual('white');
     });
+
+    it(': theme', async () => {
+      const wrapper = mount(Progress, {
+        props: { percentage: 50, theme: '' },
+      });
+      const progressDom = wrapper.find('.t-progress');
+      expect(progressDom.text()).toBeFalsy();
+      await wrapper.setProps({
+        theme: 'plump',
+      });
+      const bar = wrapper.find('.t-progress__bar');
+      expect(bar.exists()).toBeTruthy();
+      expect(bar.classes()).toContain('t-progress--plump');
+    });
   });
 
   describe('slots', () => {