@infly/ui 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,250 +1,250 @@
1
- /**
2
- * BusinessSwitch 组件测试
3
- *
4
- * 验证业务开关组件的 props、按钮显隐逻辑和事件。
5
- * 注:与项目现有测试一致,不依赖 Element UI 的全局注册。
6
- */
7
- const { mount } = require("../../../test/helper");
8
- const BusinessSwitch = require("./BusinessSwitch.vue");
9
-
10
- describe("BusinessSwitch", () => {
11
- describe("渲染", () => {
12
- it("渲染 comp-BusinessSwitch 容器", () => {
13
- const wrapper = mount(BusinessSwitch, {
14
- propsData: { value: 1 },
15
- });
16
- assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
17
- wrapper.destroy();
18
- });
19
-
20
- it("默认 showSwitch=true 时渲染开关(存在容器)", () => {
21
- const wrapper = mount(BusinessSwitch, {
22
- propsData: { value: 1, showSwitch: true },
23
- });
24
- assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
25
- wrapper.destroy();
26
- });
27
-
28
- it("showSwitch=false 时仍然渲染容器", () => {
29
- const wrapper = mount(BusinessSwitch, {
30
- propsData: { value: 1, showSwitch: false },
31
- });
32
- assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
33
- wrapper.destroy();
34
- });
35
- });
36
-
37
- describe("Props", () => {
38
- it("接收 value prop", () => {
39
- const wrapper = mount(BusinessSwitch, {
40
- propsData: { value: 1 },
41
- });
42
- assert.equal(wrapper.props().value, 1);
43
- wrapper.destroy();
44
- });
45
-
46
- it("默认 activeValue 为 1", () => {
47
- const wrapper = mount(BusinessSwitch, {
48
- propsData: { value: 0 },
49
- });
50
- assert.equal(wrapper.props().activeValue, 1);
51
- wrapper.destroy();
52
- });
53
-
54
- it("默认 inactiveValue 为 0", () => {
55
- const wrapper = mount(BusinessSwitch, {
56
- propsData: { value: 1 },
57
- });
58
- assert.equal(wrapper.props().inactiveValue, 0);
59
- wrapper.destroy();
60
- });
61
-
62
- it("支持自定义 activeValue 和 inactiveValue", () => {
63
- const wrapper = mount(BusinessSwitch, {
64
- propsData: {
65
- value: "enabled",
66
- activeValue: "enabled",
67
- inactiveValue: "disabled",
68
- },
69
- });
70
- assert.equal(wrapper.props().activeValue, "enabled");
71
- assert.equal(wrapper.props().inactiveValue, "disabled");
72
- wrapper.destroy();
73
- });
74
-
75
- it("支持 disabled prop", () => {
76
- const wrapper = mount(BusinessSwitch, {
77
- propsData: { value: 0, disabled: true },
78
- });
79
- assert.equal(wrapper.props().disabled, true);
80
- wrapper.destroy();
81
- });
82
-
83
- it("disabled 默认为 false", () => {
84
- const wrapper = mount(BusinessSwitch, {
85
- propsData: { value: 0 },
86
- });
87
- assert.equal(wrapper.props().disabled, false);
88
- wrapper.destroy();
89
- });
90
-
91
- it("value 支持 Boolean/String/Number 类型", () => {
92
- const boolWrapper = mount(BusinessSwitch, {
93
- propsData: { value: true },
94
- });
95
- assert.equal(boolWrapper.props().value, true);
96
- boolWrapper.destroy();
97
-
98
- const strWrapper = mount(BusinessSwitch, {
99
- propsData: { value: "1" },
100
- });
101
- assert.equal(strWrapper.props().value, "1");
102
- strWrapper.destroy();
103
- });
104
- });
105
-
106
- describe("按钮显示逻辑(showButton 计算属性)", () => {
107
- it("默认 showButtonWhen='1' 且 value='1' 时 showButton 为 true", () => {
108
- const wrapper = mount(BusinessSwitch, {
109
- propsData: { value: "1" },
110
- });
111
- assert.equal(wrapper.vm.showButton, true);
112
- wrapper.destroy();
113
- });
114
-
115
- it("value 不匹配 showButtonWhen 时 showButton 为 false", () => {
116
- const wrapper = mount(BusinessSwitch, {
117
- propsData: { value: "0", showButtonWhen: "1" },
118
- });
119
- assert.equal(wrapper.vm.showButton, false);
120
- wrapper.destroy();
121
- });
122
-
123
- it("hideButton=true(布尔值)时 showButton 为 false", () => {
124
- const wrapper = mount(BusinessSwitch, {
125
- propsData: { value: "1", hideButton: true },
126
- });
127
- assert.equal(wrapper.vm.showButton, false);
128
- wrapper.destroy();
129
- });
130
-
131
- it("hideButton=false(布尔值)时 showButton 由 value 匹配决定", () => {
132
- const wrapper = mount(BusinessSwitch, {
133
- propsData: { value: "1", hideButton: false },
134
- });
135
- assert.equal(wrapper.vm.showButton, true);
136
- wrapper.destroy();
137
- });
138
-
139
- it("hideButton='false'(字符串,isBoolean 只识别 typeof boolean)时不生效,回退到 value 匹配", () => {
140
- // Uts.isBoolean 仅对 typeof === 'boolean' 返回 true,字符串 'false' 不是 boolean
141
- const wrapper = mount(BusinessSwitch, {
142
- propsData: { value: "1", hideButton: "false" },
143
- });
144
- assert.equal(wrapper.vm.showButton, true);
145
- wrapper.destroy();
146
- });
147
-
148
- it("支持自定义 showButtonWhen", () => {
149
- const wrapper = mount(BusinessSwitch, {
150
- propsData: { value: "active", showButtonWhen: "active" },
151
- });
152
- assert.equal(wrapper.vm.showButton, true);
153
- wrapper.destroy();
154
- });
155
-
156
- it("支持自定义 buttonText", () => {
157
- const wrapper = mount(BusinessSwitch, {
158
- propsData: { value: "1", buttonText: "编辑" },
159
- });
160
- assert.equal(wrapper.props().buttonText, "编辑");
161
- wrapper.destroy();
162
- });
163
-
164
- it("支持自定义 buttonType", () => {
165
- const wrapper = mount(BusinessSwitch, {
166
- propsData: { value: "1", buttonType: "danger" },
167
- });
168
- assert.equal(wrapper.props().buttonType, "danger");
169
- wrapper.destroy();
170
- });
171
-
172
- it("支持自定义 buttonSize", () => {
173
- const wrapper = mount(BusinessSwitch, {
174
- propsData: { value: "1", buttonSize: "small" },
175
- });
176
- assert.equal(wrapper.props().buttonSize, "small");
177
- wrapper.destroy();
178
- });
179
-
180
- it("支持自定义 buttonClass", () => {
181
- const wrapper = mount(BusinessSwitch, {
182
- propsData: { value: "1", buttonClass: "custom-btn" },
183
- });
184
- assert.equal(wrapper.props().buttonClass, "custom-btn");
185
- wrapper.destroy();
186
- });
187
-
188
- it("value 为数字 1 时匹配字符串 '1' 的 showButtonWhen(宽松比较)", () => {
189
- const wrapper = mount(BusinessSwitch, {
190
- propsData: { value: 1, showButtonWhen: "1" },
191
- });
192
- assert.equal(wrapper.vm.showButton, true);
193
- wrapper.destroy();
194
- });
195
- });
196
-
197
- describe("事件", () => {
198
- it("handleChange 同时触发 input 和 change 事件并透传新值", () => {
199
- const wrapper = mount(BusinessSwitch, {
200
- propsData: { value: 0 },
201
- });
202
- wrapper.vm.handleChange(1);
203
- assert.deepEqual(wrapper.emitted().input, [[1]]);
204
- assert.deepEqual(wrapper.emitted().change, [[1]]);
205
- wrapper.destroy();
206
- });
207
-
208
- it("handleButtonClick 触发 click 事件", () => {
209
- const wrapper = mount(BusinessSwitch, {
210
- propsData: { value: 0 },
211
- });
212
- wrapper.vm.handleChange(1);
213
- assert.ok(wrapper.emitted("input"));
214
- assert.equal(wrapper.emitted("input")[0][0], 1);
215
- wrapper.destroy();
216
- });
217
-
218
- it("handleChange 同时触发 input 和 change 事件", () => {
219
- const wrapper = mount(BusinessSwitch, {
220
- propsData: { value: 0 },
221
- });
222
- wrapper.vm.handleChange(0);
223
- assert.ok(wrapper.emitted("change"));
224
- assert.equal(wrapper.emitted("change")[0][0], 0);
225
- assert.ok(wrapper.emitted("input"));
226
- wrapper.destroy();
227
- });
228
-
229
- it("handleButtonClick 触发 click 事件并传递当前 value", () => {
230
- const wrapper = mount(BusinessSwitch, {
231
- propsData: { value: "1" },
232
- });
233
- wrapper.vm.handleButtonClick();
234
- assert.ok(wrapper.emitted("click"));
235
- assert.equal(wrapper.emitted("click")[0][0], "1");
236
- wrapper.destroy();
237
- });
238
- });
239
-
240
- describe("inheritAttrs", () => {
241
- it("透传 $attrs 到根元素", () => {
242
- const wrapper = mount(BusinessSwitch, {
243
- propsData: { value: 0 },
244
- attrs: { "data-test-id": "business-switch" },
245
- });
246
- assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
247
- wrapper.destroy();
248
- });
249
- });
250
- });
1
+ /**
2
+ * BusinessSwitch 组件测试
3
+ *
4
+ * 验证业务开关组件的 props、按钮显隐逻辑和事件。
5
+ * 注:与项目现有测试一致,不依赖 Element UI 的全局注册。
6
+ */
7
+ const { mount } = require("../../../test/helper");
8
+ const BusinessSwitch = require("./BusinessSwitch.vue");
9
+
10
+ describe("BusinessSwitch", () => {
11
+ describe("渲染", () => {
12
+ it("渲染 comp-BusinessSwitch 容器", () => {
13
+ const wrapper = mount(BusinessSwitch, {
14
+ propsData: { value: 1 },
15
+ });
16
+ assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
17
+ wrapper.destroy();
18
+ });
19
+
20
+ it("默认 showSwitch=true 时渲染开关(存在容器)", () => {
21
+ const wrapper = mount(BusinessSwitch, {
22
+ propsData: { value: 1, showSwitch: true },
23
+ });
24
+ assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
25
+ wrapper.destroy();
26
+ });
27
+
28
+ it("showSwitch=false 时仍然渲染容器", () => {
29
+ const wrapper = mount(BusinessSwitch, {
30
+ propsData: { value: 1, showSwitch: false },
31
+ });
32
+ assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
33
+ wrapper.destroy();
34
+ });
35
+ });
36
+
37
+ describe("Props", () => {
38
+ it("接收 value prop", () => {
39
+ const wrapper = mount(BusinessSwitch, {
40
+ propsData: { value: 1 },
41
+ });
42
+ assert.equal(wrapper.props().value, 1);
43
+ wrapper.destroy();
44
+ });
45
+
46
+ it("默认 activeValue 为 1", () => {
47
+ const wrapper = mount(BusinessSwitch, {
48
+ propsData: { value: 0 },
49
+ });
50
+ assert.equal(wrapper.props().activeValue, 1);
51
+ wrapper.destroy();
52
+ });
53
+
54
+ it("默认 inactiveValue 为 0", () => {
55
+ const wrapper = mount(BusinessSwitch, {
56
+ propsData: { value: 1 },
57
+ });
58
+ assert.equal(wrapper.props().inactiveValue, 0);
59
+ wrapper.destroy();
60
+ });
61
+
62
+ it("支持自定义 activeValue 和 inactiveValue", () => {
63
+ const wrapper = mount(BusinessSwitch, {
64
+ propsData: {
65
+ value: "enabled",
66
+ activeValue: "enabled",
67
+ inactiveValue: "disabled",
68
+ },
69
+ });
70
+ assert.equal(wrapper.props().activeValue, "enabled");
71
+ assert.equal(wrapper.props().inactiveValue, "disabled");
72
+ wrapper.destroy();
73
+ });
74
+
75
+ it("支持 disabled prop", () => {
76
+ const wrapper = mount(BusinessSwitch, {
77
+ propsData: { value: 0, disabled: true },
78
+ });
79
+ assert.equal(wrapper.props().disabled, true);
80
+ wrapper.destroy();
81
+ });
82
+
83
+ it("disabled 默认为 false", () => {
84
+ const wrapper = mount(BusinessSwitch, {
85
+ propsData: { value: 0 },
86
+ });
87
+ assert.equal(wrapper.props().disabled, false);
88
+ wrapper.destroy();
89
+ });
90
+
91
+ it("value 支持 Boolean/String/Number 类型", () => {
92
+ const boolWrapper = mount(BusinessSwitch, {
93
+ propsData: { value: true },
94
+ });
95
+ assert.equal(boolWrapper.props().value, true);
96
+ boolWrapper.destroy();
97
+
98
+ const strWrapper = mount(BusinessSwitch, {
99
+ propsData: { value: "1" },
100
+ });
101
+ assert.equal(strWrapper.props().value, "1");
102
+ strWrapper.destroy();
103
+ });
104
+ });
105
+
106
+ describe("按钮显示逻辑(showButton 计算属性)", () => {
107
+ it("默认 showButtonWhen='1' 且 value='1' 时 showButton 为 true", () => {
108
+ const wrapper = mount(BusinessSwitch, {
109
+ propsData: { value: "1" },
110
+ });
111
+ assert.equal(wrapper.vm.showButton, true);
112
+ wrapper.destroy();
113
+ });
114
+
115
+ it("value 不匹配 showButtonWhen 时 showButton 为 false", () => {
116
+ const wrapper = mount(BusinessSwitch, {
117
+ propsData: { value: "0", showButtonWhen: "1" },
118
+ });
119
+ assert.equal(wrapper.vm.showButton, false);
120
+ wrapper.destroy();
121
+ });
122
+
123
+ it("hideButton=true(布尔值)时 showButton 为 false", () => {
124
+ const wrapper = mount(BusinessSwitch, {
125
+ propsData: { value: "1", hideButton: true },
126
+ });
127
+ assert.equal(wrapper.vm.showButton, false);
128
+ wrapper.destroy();
129
+ });
130
+
131
+ it("hideButton=false(布尔值)时 showButton 由 value 匹配决定", () => {
132
+ const wrapper = mount(BusinessSwitch, {
133
+ propsData: { value: "1", hideButton: false },
134
+ });
135
+ assert.equal(wrapper.vm.showButton, true);
136
+ wrapper.destroy();
137
+ });
138
+
139
+ it("hideButton='false'(字符串,isBoolean 只识别 typeof boolean)时不生效,回退到 value 匹配", () => {
140
+ // Uts.isBoolean 仅对 typeof === 'boolean' 返回 true,字符串 'false' 不是 boolean
141
+ const wrapper = mount(BusinessSwitch, {
142
+ propsData: { value: "1", hideButton: "false" },
143
+ });
144
+ assert.equal(wrapper.vm.showButton, true);
145
+ wrapper.destroy();
146
+ });
147
+
148
+ it("支持自定义 showButtonWhen", () => {
149
+ const wrapper = mount(BusinessSwitch, {
150
+ propsData: { value: "active", showButtonWhen: "active" },
151
+ });
152
+ assert.equal(wrapper.vm.showButton, true);
153
+ wrapper.destroy();
154
+ });
155
+
156
+ it("支持自定义 buttonText", () => {
157
+ const wrapper = mount(BusinessSwitch, {
158
+ propsData: { value: "1", buttonText: "编辑" },
159
+ });
160
+ assert.equal(wrapper.props().buttonText, "编辑");
161
+ wrapper.destroy();
162
+ });
163
+
164
+ it("支持自定义 buttonType", () => {
165
+ const wrapper = mount(BusinessSwitch, {
166
+ propsData: { value: "1", buttonType: "danger" },
167
+ });
168
+ assert.equal(wrapper.props().buttonType, "danger");
169
+ wrapper.destroy();
170
+ });
171
+
172
+ it("支持自定义 buttonSize", () => {
173
+ const wrapper = mount(BusinessSwitch, {
174
+ propsData: { value: "1", buttonSize: "small" },
175
+ });
176
+ assert.equal(wrapper.props().buttonSize, "small");
177
+ wrapper.destroy();
178
+ });
179
+
180
+ it("支持自定义 buttonClass", () => {
181
+ const wrapper = mount(BusinessSwitch, {
182
+ propsData: { value: "1", buttonClass: "custom-btn" },
183
+ });
184
+ assert.equal(wrapper.props().buttonClass, "custom-btn");
185
+ wrapper.destroy();
186
+ });
187
+
188
+ it("value 为数字 1 时匹配字符串 '1' 的 showButtonWhen(宽松比较)", () => {
189
+ const wrapper = mount(BusinessSwitch, {
190
+ propsData: { value: 1, showButtonWhen: "1" },
191
+ });
192
+ assert.equal(wrapper.vm.showButton, true);
193
+ wrapper.destroy();
194
+ });
195
+ });
196
+
197
+ describe("事件", () => {
198
+ it("handleChange 同时触发 input 和 change 事件并透传新值", () => {
199
+ const wrapper = mount(BusinessSwitch, {
200
+ propsData: { value: 0 },
201
+ });
202
+ wrapper.vm.handleChange(1);
203
+ assert.deepEqual(wrapper.emitted().input, [[1]]);
204
+ assert.deepEqual(wrapper.emitted().change, [[1]]);
205
+ wrapper.destroy();
206
+ });
207
+
208
+ it("handleButtonClick 触发 click 事件", () => {
209
+ const wrapper = mount(BusinessSwitch, {
210
+ propsData: { value: 0 },
211
+ });
212
+ wrapper.vm.handleChange(1);
213
+ assert.ok(wrapper.emitted("input"));
214
+ assert.equal(wrapper.emitted("input")[0][0], 1);
215
+ wrapper.destroy();
216
+ });
217
+
218
+ it("handleChange 同时触发 input 和 change 事件", () => {
219
+ const wrapper = mount(BusinessSwitch, {
220
+ propsData: { value: 0 },
221
+ });
222
+ wrapper.vm.handleChange(0);
223
+ assert.ok(wrapper.emitted("change"));
224
+ assert.equal(wrapper.emitted("change")[0][0], 0);
225
+ assert.ok(wrapper.emitted("input"));
226
+ wrapper.destroy();
227
+ });
228
+
229
+ it("handleButtonClick 触发 click 事件并传递当前 value", () => {
230
+ const wrapper = mount(BusinessSwitch, {
231
+ propsData: { value: "1" },
232
+ });
233
+ wrapper.vm.handleButtonClick();
234
+ assert.ok(wrapper.emitted("click"));
235
+ assert.equal(wrapper.emitted("click")[0][0], "1");
236
+ wrapper.destroy();
237
+ });
238
+ });
239
+
240
+ describe("inheritAttrs", () => {
241
+ it("透传 $attrs 到根元素", () => {
242
+ const wrapper = mount(BusinessSwitch, {
243
+ propsData: { value: 0 },
244
+ attrs: { "data-test-id": "business-switch" },
245
+ });
246
+ assert.ok(wrapper.find(".comp-BusinessSwitch").exists());
247
+ wrapper.destroy();
248
+ });
249
+ });
250
+ });
@@ -1,70 +1,70 @@
1
- /**
2
- * BusinessTag 组件测试
3
- *
4
- * 验证业务标签组件的标签类型解析、文本解析和自定义 prop 映射。
5
- * 注:与项目现有测试一致,通过 vm 访问计算属性而非检查 Element UI DOM 类。
6
- */
7
- const { mount } = require("../../../test/helper");
8
- const BusinessTag = require("./BusinessTag.vue");
9
-
10
- const MOCK_OPTIONS = [
11
- { name: "启用", value: "1", tagType: "success" },
12
- { name: "禁用", value: "0", tagType: "danger" },
13
- { name: "审核中", value: "2", tagType: "warning" },
14
- ];
15
-
16
- describe("BusinessTag", () => {
17
- describe("渲染", () => {
18
- it("渲染成功(不抛异常)", () => {
19
- const wrapper = mount(BusinessTag, {
20
- propsData: { value: "1", options: MOCK_OPTIONS },
21
- });
22
- assert.ok(wrapper.exists());
23
- wrapper.destroy();
24
- });
25
-
26
- it("支持自定义 tagTypeProp", () => {
27
- const wrapper = mount(BusinessTag, {
28
- propsData: {
29
- options: [
30
- { label: "已支付", id: 1, status: "success" },
31
- { label: "待支付", id: 2, status: "warning" },
32
- ],
33
- value: 2,
34
- valueProp: "id",
35
- nameProp: "label",
36
- tagTypeProp: "status",
37
- },
38
- });
39
- assert.equal(wrapper.vm.tagType, "warning");
40
- assert.equal(wrapper.vm.tagTypeText, "待支付");
41
- wrapper.destroy();
42
- });
43
- });
44
-
45
- describe("边界行为", () => {
46
- it("空 options 时回退到默认类型和原始值", () => {
47
- const wrapper = mount(BusinessTag, {
48
- propsData: { options: [], value: "未知状态" },
49
- });
50
- assert.equal(wrapper.vm.tagType, "info");
51
- assert.equal(wrapper.vm.tagTypeText, "未知状态");
52
- wrapper.destroy();
53
- });
54
-
55
- it("数字 0 能匹配选项而不被当作空值", () => {
56
- const wrapper = mount(BusinessTag, {
57
- propsData: {
58
- options: [
59
- { name: "有效", value: 1, tagType: "success" },
60
- { name: "无效", value: 0, tagType: "danger" },
61
- ],
62
- value: 0,
63
- },
64
- });
65
- assert.equal(wrapper.vm.tagType, "danger");
66
- assert.equal(wrapper.vm.tagTypeText, "无效");
67
- wrapper.destroy();
68
- });
69
- });
70
- });
1
+ /**
2
+ * BusinessTag 组件测试
3
+ *
4
+ * 验证业务标签组件的标签类型解析、文本解析和自定义 prop 映射。
5
+ * 注:与项目现有测试一致,通过 vm 访问计算属性而非检查 Element UI DOM 类。
6
+ */
7
+ const { mount } = require("../../../test/helper");
8
+ const BusinessTag = require("./BusinessTag.vue");
9
+
10
+ const MOCK_OPTIONS = [
11
+ { name: "启用", value: "1", tagType: "success" },
12
+ { name: "禁用", value: "0", tagType: "danger" },
13
+ { name: "审核中", value: "2", tagType: "warning" },
14
+ ];
15
+
16
+ describe("BusinessTag", () => {
17
+ describe("渲染", () => {
18
+ it("渲染成功(不抛异常)", () => {
19
+ const wrapper = mount(BusinessTag, {
20
+ propsData: { value: "1", options: MOCK_OPTIONS },
21
+ });
22
+ assert.ok(wrapper.exists());
23
+ wrapper.destroy();
24
+ });
25
+
26
+ it("支持自定义 tagTypeProp", () => {
27
+ const wrapper = mount(BusinessTag, {
28
+ propsData: {
29
+ options: [
30
+ { label: "已支付", id: 1, status: "success" },
31
+ { label: "待支付", id: 2, status: "warning" },
32
+ ],
33
+ value: 2,
34
+ valueProp: "id",
35
+ nameProp: "label",
36
+ tagTypeProp: "status",
37
+ },
38
+ });
39
+ assert.equal(wrapper.vm.tagType, "warning");
40
+ assert.equal(wrapper.vm.tagTypeText, "待支付");
41
+ wrapper.destroy();
42
+ });
43
+ });
44
+
45
+ describe("边界行为", () => {
46
+ it("空 options 时回退到默认类型和原始值", () => {
47
+ const wrapper = mount(BusinessTag, {
48
+ propsData: { options: [], value: "未知状态" },
49
+ });
50
+ assert.equal(wrapper.vm.tagType, "info");
51
+ assert.equal(wrapper.vm.tagTypeText, "未知状态");
52
+ wrapper.destroy();
53
+ });
54
+
55
+ it("数字 0 能匹配选项而不被当作空值", () => {
56
+ const wrapper = mount(BusinessTag, {
57
+ propsData: {
58
+ options: [
59
+ { name: "有效", value: 1, tagType: "success" },
60
+ { name: "无效", value: 0, tagType: "danger" },
61
+ ],
62
+ value: 0,
63
+ },
64
+ });
65
+ assert.equal(wrapper.vm.tagType, "danger");
66
+ assert.equal(wrapper.vm.tagTypeText, "无效");
67
+ wrapper.destroy();
68
+ });
69
+ });
70
+ });