From 1df3ccb642e2df8e73ec5407aa16d584b0401f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Mon, 8 Jul 2024 11:27:11 +0200 Subject: [PATCH] fix(utils): unchanged categories table markdown content --- .../lib/reports/__snapshots__/report-diff-unchanged.md | 8 ++++---- .../utils/src/lib/reports/generate-md-reports-diff.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/utils/src/lib/reports/__snapshots__/report-diff-unchanged.md b/packages/utils/src/lib/reports/__snapshots__/report-diff-unchanged.md index 93b368315..fe4862cf5 100644 --- a/packages/utils/src/lib/reports/__snapshots__/report-diff-unchanged.md +++ b/packages/utils/src/lib/reports/__snapshots__/report-diff-unchanged.md @@ -4,11 +4,11 @@ ## 🏷️ Categories -|🏷️ Category|⭐ Previous score| +|🏷️ Category|⭐ Score| |:--|:--:| -|Performance|| -|Bug prevention|| -|Code style|| +|Performance|🟢 92| +|Bug prevention|🟡 68| +|Code style|🟡 54| ## 🗃️ Groups diff --git a/packages/utils/src/lib/reports/generate-md-reports-diff.ts b/packages/utils/src/lib/reports/generate-md-reports-diff.ts index c1e43a551..70d0cb78f 100644 --- a/packages/utils/src/lib/reports/generate-md-reports-diff.ts +++ b/packages/utils/src/lib/reports/generate-md-reports-diff.ts @@ -80,8 +80,8 @@ function formatDiffCategoriesSection(diff: ReportsDiff): string { const columns: TableColumnObject[] = [ { key: 'category', label: '🏷️ Category', align: 'left' }, - { key: 'before', label: '⭐ Previous score' }, - { key: 'after', label: hasChanges ? '⭐ Current score' : '⭐ Score' }, + { key: 'before', label: hasChanges ? '⭐ Previous score' : '⭐ Score' }, + { key: 'after', label: '⭐ Current score' }, { key: 'change', label: '🔄 Score change' }, ]; return lines( @@ -111,7 +111,7 @@ function formatDiffCategoriesSection(diff: ReportsDiff): string { change: '–', })), ].map(row => - hasChanges ? row : { category: row.category, after: row.after }, + hasChanges ? row : { category: row.category, before: row.before }, ), }), added.length > 0 && section(italicMd('(\\*) New category.')),