Skip to content

Commit ade7165

Browse files
authored
refactor(wizard): [wizard] refactor the Wizard Theme (#2279)
* refactor(wizard): [wizard] 重构wizard主题 * refactor(wizard): [wizard] 修复测试用例报错
1 parent 390563d commit ade7165

File tree

10 files changed

+347
-365
lines changed

10 files changed

+347
-365
lines changed

examples/sites/demos/pc/app/wizard/base-usage.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ test('基本用法', async ({ page }) => {
1010
const chartCount = 5
1111
const itemStatus = [/is-ready/, /is-doing/]
1212
const descs = ['出差信息填写', '项目信息填写', '主管审批', '权签人审批', '完成申请']
13-
const readyColor = 'rgb(94, 124, 224)'
1413

1514
await expect(charts).toHaveCount(chartCount)
1615
for (let i = 0; i < chartCount; i++) {
@@ -20,21 +19,24 @@ test('基本用法', async ({ page }) => {
2019
const middle = itemList.nth(1)
2120
const last = itemList.nth(2)
2221

23-
await expect(items).toHaveCSS('width', '120px')
24-
await expect(items).toHaveCSS('height', '20px')
22+
await expect(items).toHaveCSS('width', '100px')
23+
await expect(items).toHaveCSS('height', '32px')
2524
await expect(first).toHaveClass('tiny-wizard__chart-line')
2625
await expect(middle).toHaveClass(/tiny-wizard__chart-icon/)
2726
await expect(middle).toHaveText(String(i + 1))
2827
await expect(last).toHaveClass('tiny-wizard__chart-line')
2928
await expect(names.nth(i)).toHaveText(descs[i])
3029

31-
if (i < 2) {
30+
if (i < 1) {
3231
await expect(stepItems.nth(i)).toHaveClass(itemStatus[i])
33-
await expect(first).toHaveCSS('background-color', readyColor)
34-
await expect(middle).toHaveCSS('background-color', readyColor)
32+
await expect(first).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
33+
await expect(middle).toHaveCSS('background-color', 'rgb(255, 255, 255)')
34+
} else if (i === 1) {
35+
await expect(first).toHaveCSS('background-color', 'rgb(25, 25, 25)')
36+
await expect(middle).toHaveCSS('background-color', 'rgb(255, 255, 255)')
3537
} else {
36-
await expect(first).toHaveCSS('background-color', 'rgb(194, 196, 199)')
37-
await expect(middle).toHaveCSS('background-color', 'rgb(223, 225, 230)')
38+
await expect(first).toHaveCSS('background-color', 'rgb(219, 219, 219)')
39+
await expect(middle).toHaveCSS('background-color', 'rgb(240, 240, 240)')
3840
}
3941
}
4042
})

examples/sites/demos/pc/app/wizard/time-line-flow.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ test('时间线流程图', async ({ page }) => {
3333
await expect(details).toHaveCount(3)
3434
await expect(userNames).toHaveCount(3)
3535
for (let i = 0; i < 3; i++) {
36-
await expect(childNodeLines.nth(i)).toHaveCSS('width', '4px')
36+
await expect(childNodeLines.nth(i)).toHaveCSS('width', '1px')
3737
await expect(childNodeLines.nth(i)).toHaveCSS('height', '88px')
3838
await expect(details.nth(i)).toHaveText(texts[i])
3939
await expect(childNodeDates.nth(i)).toHaveText(/20*1*:50/)
4040

4141
if (i === 2) {
42-
await expect(childNodeLines.nth(i)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
42+
await expect(childNodeLines.nth(i)).toHaveCSS('background-color', 'rgb(25, 25, 25)')
4343
}
4444
if (i < 2) {
45-
await expect(nodeIcons.nth(i)).toHaveCSS('width', '16px')
46-
await expect(nodeIcons.nth(i)).toHaveCSS('height', '20px')
47-
await expect(nodeLines.nth(i)).toHaveCSS('width', '4px')
45+
await expect(nodeIcons.nth(i)).toHaveCSS('width', '32px')
46+
await expect(nodeIcons.nth(i)).toHaveCSS('height', '32px')
47+
await expect(nodeLines.nth(i)).toHaveCSS('width', '1px')
4848
await expect(nodeLines.nth(i)).toHaveCSS('height', '88px')
4949
}
5050
}

examples/sites/demos/pc/app/wizard/vertical.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ test('垂直流程图', async ({ page }) => {
1616
await expect(nodeNames).toHaveCount(nodeCount)
1717
for (let i = 0; i < nodeCount; i++) {
1818
await expect(nodeNames.nth(i)).toHaveText(names[i])
19-
await expect(nodeLines.nth(i)).toHaveCSS('width', '4px')
20-
await expect(nodeLines.nth(i)).toHaveCSS('height', '88px')
21-
await expect(nodeIcons.nth(i)).toHaveCSS('height', '20px')
22-
await expect(nodeIcons.nth(i)).toHaveCSS('height', '20px')
19+
await expect(nodeLines.nth(i)).toHaveCSS('width', '1px')
20+
await expect(nodeLines.nth(i)).toHaveCSS('height', '60px')
21+
await expect(nodeIcons.nth(i)).toHaveCSS('height', '32px')
2322

2423
if (i === 4) {
25-
await expect(nodeLines.nth(i)).toHaveCSS('background-color', 'rgb(194, 196, 199)')
26-
await expect(nodeIcons.nth(i)).toHaveCSS('background-color', 'rgb(223, 225, 230)')
24+
await expect(nodeLines.nth(i)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
25+
await expect(nodeIcons.nth(i)).toHaveCSS('background-color', 'rgb(240, 240, 240)')
26+
} else if (i === 3) {
27+
await expect(nodeLines.nth(i)).toHaveCSS('background-color', 'rgb(219, 219, 219)')
28+
await expect(nodeIcons.nth(i)).toHaveCSS('background-color', 'rgb(255, 255, 255)')
2729
} else {
28-
await expect(nodeLines.nth(i)).toHaveCSS('background-color', 'rgb(94, 124, 224)')
29-
await expect(nodeIcons.nth(i)).toHaveCSS('background-color', 'rgb(94, 124, 224)')
30+
await expect(nodeLines.nth(i)).toHaveCSS('background-color', 'rgb(25, 25, 25)')
31+
await expect(nodeIcons.nth(i)).toHaveCSS('background-color', 'rgb(255, 255, 255)')
3032
}
3133
}
3234
})

packages/theme-saas/src/wizard/index.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@svg-wrapper-prefix-cls: ~'@{css-prefix}wizard__chart-svg';
99

1010
.@{wizard-prefix-cls} {
11-
& &__nomarl {
11+
& &__normal {
1212
.@{wizard-prefix-cls}__steps {
1313
@apply flex;
1414
}
@@ -142,7 +142,7 @@
142142
& &__steps-item {
143143
&.is-ready {
144144
.name {
145-
@apply text-color-brand;
145+
@apply text-color-brand;
146146
}
147147

148148
.@{wizard-prefix-cls}__chart-icon {
@@ -284,7 +284,7 @@
284284
}
285285

286286
.@{wizard-prefix-cls} {
287-
.@{wizard-prefix-cls}__nomarl {
287+
.@{wizard-prefix-cls}__normal {
288288
.@{wizard-prefix-cls}__steps-item {
289289
.@{wizard-prefix-cls}__chart-icon {
290290
@apply w-6;

packages/theme/src/mixins/wizard.less

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)