From 6f39eb897c99ce09f3f90c9581440f91887f36cd Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Sun, 16 Aug 2026 21:40:07 +0200 Subject: [PATCH] fix(pleno-vue): make wax product title brand-agnostic (TRU-130) (#319) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Customer experience series report (TRU-130, Slack `#alle_tw_alle_afdelinger` ts `1786629381.499969`) noted that the wax product ("Højglans - Voksforsegling pr. enhed", product_id 26) tested poorly in the field and the operations team is trialing a different wax supplier. While the API payload drives the actual daily-report product title, the `FALLBACK_PRODUCT_TITLES` map in the Vue display component and the matching e2e expectations still hardcoded the failed brand name. After the supplier swap the tile would have shown a stale brand even when the API reports the new product, and the test expectations would have failed on legitimate label updates. ## Changes - `src/views/dashboards/departmentDashboard/modules/daily-report/displays/DepartmentDashboardDailyReportProductSales.vue` - Drop the `Højglans - ` prefix from the product 26 fallback title so the tile stays accurate while the wax supplier is iterated on. - Add a TRU-130 reference comment explaining the choice. - `src/components/displays/department/pos/displays/Piktogrammer.vue` - Update the product 26 comment to be brand-agnostic. - `tests/e2e/admin-daily-report.spec.ts` - Update the two `daily-report-tile-hoejglans` expectations to match the new fallback title. - `tests/unit/department-daily-report-product-sales.behavior.spec.js` - Add a regression test that locks the brand-agnostic fallback for product 26. ## Verification - `npx vitest run tests/unit/department-daily-report-product-sales.behavior.spec.js` → 5 tests passed (including the new TRU-130 case). ## Linked Linear issue TRU-130 — https://linear.app/truck-wash-aps/issue/TRU-130 Co-authored-by: Pleno Bugfix Bot --- .../department/pos/displays/Piktogrammer.vue | 2 +- ...rtmentDashboardDailyReportProductSales.vue | 6 +++++- tests/e2e/admin-daily-report.spec.ts | 6 +++--- ...aily-report-product-sales.behavior.spec.js | 20 +++++++++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/displays/department/pos/displays/Piktogrammer.vue b/src/components/displays/department/pos/displays/Piktogrammer.vue index 64d437ad..300526a1 100644 --- a/src/components/displays/department/pos/displays/Piktogrammer.vue +++ b/src/components/displays/department/pos/displays/Piktogrammer.vue @@ -27,7 +27,7 @@ import productImage21 from "/src/assets/piktogrammer/21.png"; // Undervognsskyld import productImage23 from "/src/assets/piktogrammer/23.png"; // Spotfree import productImage24 from "/src/assets/piktogrammer/24.png"; // Spotfree import productImage25 from "/src/assets/piktogrammer/25.png"; // Fælg flex -import productImage26 from "/src/assets/piktogrammer/26.png"; // Højglans +import productImage26 from "/src/assets/piktogrammer/26.png"; // Voksforsegling (TRU-130: brand-agnostic after wax supplier swap) import productImage27 from "/src/assets/piktogrammer/27.png"; // 10 Minutter import productImage39 from "/src/assets/piktogrammer/39.png"; // Trailer - Varevogn import productImage43 from "/src/assets/piktogrammer/43.png"; // Handling of materials diff --git a/src/views/dashboards/departmentDashboard/modules/daily-report/displays/DepartmentDashboardDailyReportProductSales.vue b/src/views/dashboards/departmentDashboard/modules/daily-report/displays/DepartmentDashboardDailyReportProductSales.vue index 3a2e46bc..9cbce4a7 100644 --- a/src/views/dashboards/departmentDashboard/modules/daily-report/displays/DepartmentDashboardDailyReportProductSales.vue +++ b/src/views/dashboards/departmentDashboard/modules/daily-report/displays/DepartmentDashboardDailyReportProductSales.vue @@ -15,7 +15,11 @@ const FALLBACK_PRODUCT_TITLES = { 24: "Spot Free (Lastbil)", 25: "Fælg flex pr. enhed", 27: "Ekstraordinær pr. 10 min inkl. kemi", - 26: "Højglans - Voksforsegling pr. enhed", + // TRU-130: customer experience series reported that the previous wax product + // ("Højglans - Voksforsegling") tested poorly and is being swapped for a + // different product. Drop the brand-specific prefix so the tile stays + // accurate while the operations team iterates on the next wax supplier. + 26: "Voksforsegling pr. enhed", 21: "Undervognsskyl pr. enhed", 22: "Tillæg for Specialsæbe - DD", }; diff --git a/tests/e2e/admin-daily-report.spec.ts b/tests/e2e/admin-daily-report.spec.ts index 2d398503..fffd7634 100644 --- a/tests/e2e/admin-daily-report.spec.ts +++ b/tests/e2e/admin-daily-report.spec.ts @@ -64,7 +64,7 @@ const buildOverviewPayload = ({ { product_id: 26, slug: "hoejglans", - title: "Højglans - Voksforsegling pr. enhed", + title: "Voksforsegling pr. enhed", state: "ready", value: 4, out_of: 8, @@ -268,7 +268,7 @@ test.describe("Admin daily report", () => { await expect(page.getByTestId("daily-report-tile-extraordinary-10-min")).toContainText( "Ekstraordinær pr. 10 min inkl. kemi" ); - await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Højglans - Voksforsegling pr. enhed"); + await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Voksforsegling pr. enhed"); await expect(page.getByTestId("daily-report-tile-undervognsskyl")).toContainText("Undervognsskyl pr. enhed"); await expect(page.getByTestId("daily-report-tile-double-duty-kemi")).toContainText("Tillæg for Specialsæbe - DD"); }); @@ -667,7 +667,7 @@ test.describe("Admin daily report", () => { await expect(page.getByTestId("daily-report-tile-extraordinary-10-min")).toContainText( "Ekstraordinær pr. 10 min inkl. kemi" ); - await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Højglans - Voksforsegling pr. enhed"); + await expect(page.getByTestId("daily-report-tile-hoejglans")).toContainText("Voksforsegling pr. enhed"); await expect(page.getByTestId("daily-report-tile-undervognsskyl")).toContainText("Undervognsskyl pr. enhed"); await expect(page.getByTestId("daily-report-tile-double-duty-kemi")).toContainText("Tillæg for Specialsæbe - DD"); }); diff --git a/tests/unit/department-daily-report-product-sales.behavior.spec.js b/tests/unit/department-daily-report-product-sales.behavior.spec.js index cd5d2818..ae01ca25 100644 --- a/tests/unit/department-daily-report-product-sales.behavior.spec.js +++ b/tests/unit/department-daily-report-product-sales.behavior.spec.js @@ -106,6 +106,26 @@ describe("DepartmentDashboardDailyReportProductSales behavior", () => { expect(missingTileWrapper.text()).toContain("Tillæg for Specialsæbe - DD"); }); + it("falls back to a brand-agnostic wax title for product 26 (TRU-130)", () => { + // TRU-130: the previous wax product ("Højglans - Voksforsegling") tested + // poorly in the field and is being replaced. The fallback title should + // therefore stay brand-agnostic so the tile keeps matching whatever + // wax product the API eventually reports. + dailyReportProductsState.value = {}; + + const waxWrapper = mount(DepartmentDashboardDailyReportProductSales, { + props: { + product_id: 26, + subtitle: "Dagens salg af produktet", + dataTestid: "daily-report-tile-hoejglans", + }, + }); + + const rendered = waxWrapper.text(); + expect(rendered).toContain("Voksforsegling pr. enhed"); + expect(rendered).not.toContain("Højglans"); + }); + it("shows a saved target percentage below the product percentage", () => { dailyReportProductsState.value = { 24: {