Skip to content

Commit 3e3f750

Browse files
committed
- refine styling of summary tables
- FIX #1262
1 parent 731f74e commit 3e3f750

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

__tests__/table.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ const NORMAL_TABLE = [
2121
header: true
2222
},
2323
{
24-
data: 'Skipped ⏭️',
24+
data: 'Skipped',
2525
header: true
2626
},
2727
{
28-
data: 'Failed',
28+
data: 'Failed',
2929
header: true
3030
}
3131
],

src/table.ts

+14-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ export function buildSummaryTables(
99
flakySummary: boolean,
1010
groupSuite = false
1111
): [SummaryTableRow[], SummaryTableRow[], SummaryTableRow[]] {
12+
// only include a warning icon if there are skipped tests
13+
const hasPassed = testResults.some(testResult => testResult.passed > 0)
14+
const hasSkipped = testResults.some(testResult => testResult.skipped > 0)
15+
const hasFailed = testResults.some(testResult => testResult.failed > 0)
16+
17+
const passedHeader = hasPassed ? (hasFailed ? 'Passed ☑️' : 'Passed ✅') : 'Passed'
18+
const skippedHeader = hasSkipped ? 'Skipped ⚠️' : 'Skipped'
19+
const failedHeader = hasFailed ? 'Failed ❌️' : 'Failed'
20+
1221
const table: SummaryTableRow[] = [
1322
[
1423
{data: '', header: true},
1524
{data: 'Tests', header: true},
16-
{data: 'Passed ✅', header: true},
17-
{data: 'Skipped ⏭️', header: true},
18-
{data: 'Failed ❌', header: true}
25+
{data: passedHeader, header: true},
26+
{data: skippedHeader, header: true},
27+
{data: failedHeader, header: true}
1928
]
2029
]
2130

@@ -68,7 +77,7 @@ export function buildSummaryTables(
6877
annotation.status === 'success'
6978
? '✅ pass'
7079
: annotation.status === 'skipped'
71-
? `⏭️ skipped`
80+
? `⚠️️ skipped`
7281
: `❌ ${annotation.annotation_level}`
7382
}`
7483
])
@@ -111,7 +120,7 @@ function appendDetailsTable(
111120
annotation.status === 'success'
112121
? '✅ pass'
113122
: annotation.status === 'skipped'
114-
? `⏭️ skipped`
123+
? `⚠️️ skipped`
115124
: `❌ ${annotation.annotation_level}`
116125
}`
117126
])

0 commit comments

Comments
 (0)