From b68e058e3a4f1f20e76a425206302f860de27609 Mon Sep 17 00:00:00 2001 From: Jordan Lawrence Date: Fri, 16 Aug 2024 16:24:22 +0100 Subject: [PATCH] fix(ci): fixing md formatting with linebreak in detail --- packages/sanity/playwright-ct/scripts/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sanity/playwright-ct/scripts/utils.ts b/packages/sanity/playwright-ct/scripts/utils.ts index 8ab449eb8fa..094ae489bc1 100644 --- a/packages/sanity/playwright-ct/scripts/utils.ts +++ b/packages/sanity/playwright-ct/scripts/utils.ts @@ -137,13 +137,13 @@ function generateMarkdownTable(rows: SummaryRow[]) { } function generateTestingSummary(rows: SummaryRow[]) { - const hasFailedTests = rows.some((row) => row.totalFailed > 0) + const failedTestCount = sumBy(rows, 'totalFailed') - return `${hasFailedTests ? '❌ Failed Tests' : '✅ All Tests Passed'} -- open for details` + return `${failedTestCount > 0 ? `❌ Failed Tests (${failedTestCount})` : '✅ All Tests Passed'} -- expand for details` } function formatAsCollapsable(summary: string, detail: string) { - return `
${summary}${detail}
` + return `
\n${summary}\n\n${detail}\n
` } /**