diff --git a/scripts/run-playwright-full-slice.mjs b/scripts/run-playwright-full-slice.mjs index 81e3a1ab..1a9a71e9 100644 --- a/scripts/run-playwright-full-slice.mjs +++ b/scripts/run-playwright-full-slice.mjs @@ -20,6 +20,7 @@ export const ownedFilesByRole = { "auth.smoke.spec.js", "booking-selfserve.smoke.spec.js", "connectivityIssue.spec.ts", + "date-period-selector.smoke.spec.js", "example.spec.ts", "guest-book-wash-mobile.spec.ts", "i18n-v2-integrity.spec.ts", @@ -101,12 +102,14 @@ export const ownedFilesByRole = { "superuser-customer-complaints.spec.ts", "superuser-customers-mass-import.spec.ts", "superuser-department-branding.spec.js", + "superuser-department-shells.spec.js", "superuser-department-overview.spec.js", "superuser-department-gates.spec.ts", "superuser-department-lanes.spec.ts", "superuser-department-pricing-custom-only.spec.ts", "superuser-departments-archive.spec.ts", "superuser-drafts.spec.ts", + "superuser-orders-date-filters.spec.ts", "superuser-products-layout.spec.ts", "superuser-roles-permissions.spec.ts", "superuser-system-status.smoke.spec.js", diff --git a/src/components/displays/superuser/system/SystemStatusDashboard.vue b/src/components/displays/superuser/system/SystemStatusDashboard.vue index 42059b41..ab96a29b 100644 --- a/src/components/displays/superuser/system/SystemStatusDashboard.vue +++ b/src/components/displays/superuser/system/SystemStatusDashboard.vue @@ -1114,9 +1114,10 @@ function modulePath(key) { } .module-card__top { - display: grid; - grid-template-columns: minmax(0, 1fr) auto; + display: flex; + flex-wrap: wrap; align-items: start; + justify-content: space-between; column-gap: 0.75rem; row-gap: 0.35rem; } @@ -1131,6 +1132,7 @@ function modulePath(key) { .module-card__title { margin: 0; + flex: 1 1 12rem; min-width: 0; text-transform: none; letter-spacing: 0.04em; @@ -1139,8 +1141,8 @@ function modulePath(key) { } .module-card__top .status-pill { - justify-self: end; - align-self: start; + flex: 0 0 auto; + margin-left: auto; } .gateway-card__title { diff --git a/tests/e2e/invoicing-period.smoke.spec.js b/tests/e2e/invoicing-period.smoke.spec.js index 14bdc18d..7b2e3a99 100644 --- a/tests/e2e/invoicing-period.smoke.spec.js +++ b/tests/e2e/invoicing-period.smoke.spec.js @@ -1,6 +1,5 @@ import { expect, test } from "@playwright/test"; import { mockApi, seedAuthenticatedState } from "./support/network.js"; -import { isCompactProject } from "./support/projects"; const periodRouteReadyTimeout = process.env.CI ? 30_000 : 15_000; @@ -2306,24 +2305,13 @@ test.describe("Invoicing period tab", () => { }); }); - test("@smoke period month shortcuts select whole calendar months", async ({ page }, testInfo) => { - const isCompact = isCompactProject(testInfo); - + test("@smoke period month shortcuts select whole calendar months", async ({ page }) => { await page.clock.setFixedTime(new Date("2026-05-04T10:00:00.000Z")); const { periodRequests } = await openPeriodView(page); const initialRequestCount = periodRequests.length; - if (isCompact) { - const select = page.getByTestId("date-period-shortcuts"); - const label = await select - .locator("option") - .filter({ hasText: /sidste måned|last month/i }) - .first() - .textContent(); - await select.selectOption({ label: label.trim() }); - } else { - await page.getByRole("button", { name: /last month|sidste måned/i }).click(); - } + await page.getByTestId("date-period-other-dropdown-trigger").click(); + await page.getByTestId("date-period-other-last_month").click(); await expect.poll(() => periodRequests.length).toBeGreaterThan(initialRequestCount); await expect diff --git a/tests/unit/date-period-selector.spec.js b/tests/unit/date-period-selector.spec.js index fd80d68d..a6527a04 100644 --- a/tests/unit/date-period-selector.spec.js +++ b/tests/unit/date-period-selector.spec.js @@ -384,7 +384,7 @@ describe("DatePeriodSelector month warning", () => { ); }); - it("opens the month selector from Other month on mobile", async () => { + it("opens the month modal from Other month on mobile", async () => { sharedState.width.value = 480; const wrapper = mountWithApp(DatePeriodSelector, { messages, @@ -405,12 +405,15 @@ describe("DatePeriodSelector month warning", () => { }, }); + await wrapper.get("[data-testid='date-period-other-dropdown-trigger']").trigger("click"); + expect(wrapper.get("[data-testid='date-period-other-other_month']").text()).toContain("Other month"); expect(wrapper.find("[data-testid='date-period-month']").exists()).toBe(false); await wrapper.get("[data-testid='date-period-other-other_month']").trigger("click"); - expect(wrapper.get("[data-testid='date-period-month']").exists()).toBe(true); + expect(wrapper.get("[data-testid='date-period-other-month-modal']").exists()).toBe(true); + expect(wrapper.get("[data-testid='date-period-other-month-picker']").exists()).toBe(true); }); it("selects Anytime for empty ranges without highlighting Today", () => { diff --git a/tests/unit/department-daily-report-complaints.spec.js b/tests/unit/department-daily-report-complaints.spec.js index 76270514..d6ed0188 100644 --- a/tests/unit/department-daily-report-complaints.spec.js +++ b/tests/unit/department-daily-report-complaints.spec.js @@ -91,9 +91,12 @@ const formatDisplayedDate = (isoDate) => { return ""; } - return `${day}/${month}/${year}`; + return `${month}/${day}/${year}`; }; +const getWashDateInput = (wrapper) => + wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').get("input"); + describe("DepartmentDashboardDailyReportComplaints", () => { beforeEach(() => { vi.useFakeTimers(); @@ -129,7 +132,7 @@ describe("DepartmentDashboardDailyReportComplaints", () => { await flushPromises(); expect(wrapper.get('[data-testid="daily-report-complaints-department-select"]').element.value).toBe("1"); - expect(wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').element.value).toBe("23/03/2026"); + expect(getWashDateInput(wrapper).element.value).toBe("03/23/2026"); expect(wrapper.find('[data-testid="daily-report-complaints-date-note"]').exists()).toBe(false); }); @@ -143,7 +146,7 @@ describe("DepartmentDashboardDailyReportComplaints", () => { await flushPromises(); expect(wrapper.get('[data-testid="daily-report-complaints-department-select"]').element.value).toBe("2"); - expect(wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').element.value).toBe(""); + expect(getWashDateInput(wrapper).element.value).toBe(""); expect(wrapper.get('[data-testid="daily-report-complaints-date-note"]').text()).toContain("konkrete vask"); }); @@ -160,7 +163,7 @@ describe("DepartmentDashboardDailyReportComplaints", () => { await wrapper.get('[data-testid="daily-report-complaints-add-button"]').trigger("click"); await flushPromises(); - expect(wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').element.value).toBe("23/03/2026"); + expect(getWashDateInput(wrapper).element.value).toBe("03/23/2026"); expect(wrapper.get('[data-testid="daily-report-complaints-category-select"]').element.value).toBe(""); expect(wrapper.get('[data-testid="daily-report-complaints-description-textarea"]').element.value).toBe(""); expect(wrapper.find('[data-testid="daily-report-complaints-customer-selected"]').exists()).toBe(false); @@ -180,7 +183,7 @@ describe("DepartmentDashboardDailyReportComplaints", () => { expect(createComplaintMock).not.toHaveBeenCalled(); expect(wrapper.get('[data-testid="daily-report-complaints-validation-error"]').text()).toContain("Dato for vask"); - await wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').setValue("21/03/2026"); + await getWashDateInput(wrapper).setValue("03/21/2026"); await wrapper.get('[data-testid="daily-report-complaints-submit"]').trigger("click"); await flushPromises(); @@ -203,9 +206,7 @@ describe("DepartmentDashboardDailyReportComplaints", () => { await wrapper.get('[data-testid="daily-report-complaints-add-button"]').trigger("click"); await flushPromises(); - expect(wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').element.value).toBe( - formatDisplayedDate(today) - ); + expect(getWashDateInput(wrapper).element.value).toBe(formatDisplayedDate(today)); await wrapper.get('[data-testid="daily-report-complaints-category-select"]').setValue("service"); await wrapper.get('[data-testid="daily-report-complaints-description-textarea"]').setValue("Machine damaged cargo"); await wrapper.get('[data-testid="daily-report-complaints-submit"]').trigger("click"); @@ -243,7 +244,7 @@ describe("DepartmentDashboardDailyReportComplaints", () => { expect(wrapper.get('[data-testid="daily-report-complaints-customer-selected"]').element.value).toBe( "Acme Transport - 12345" ); - expect(wrapper.get('[data-testid="daily-report-complaints-wash-date-input"]').element.value).toBe("23/03/2026"); + expect(getWashDateInput(wrapper).element.value).toBe("03/23/2026"); await wrapper.get('[data-testid="daily-report-complaints-category-select"]').setValue("wash_quality"); await wrapper diff --git a/tests/unit/department-modules-setup-self-serve.spec.js b/tests/unit/department-modules-setup-self-serve.spec.js index 24ed297b..61ba76c4 100644 --- a/tests/unit/department-modules-setup-self-serve.spec.js +++ b/tests/unit/department-modules-setup-self-serve.spec.js @@ -16,7 +16,6 @@ describe("DepartmentModulesSetup self-serve management regression", () => { }); it("renders a dedicated self-serve module switch in setup UI", () => { - expect(source).toContain('subtitle="Selvvask"'); expect(source).toContain('title="Selvvask"'); expect(source).toContain("Aktiver selvvask i denne afdeling."); }); diff --git a/tests/unit/superuser-department-overview.spec.js b/tests/unit/superuser-department-overview.spec.js index 197e7153..07a0327c 100644 --- a/tests/unit/superuser-department-overview.spec.js +++ b/tests/unit/superuser-department-overview.spec.js @@ -47,6 +47,29 @@ vi.mock("@/components/session/token/SessionUser.vue", () => ({ toLocal: (value) => `local:${value}`, }, }, + objects: { + global: { + language: { + text: { + today: "Today", + anytime: "Anytime", + yesterday: "Yesterday", + last_7_days: "Last 7 days", + this_week: "This week", + last_week: "Last week", + this_month: "This month", + last_month: "Last month", + other_month: "Other month", + same_week_last_year: "Same week last year", + same_month_last_year: "Same month last year", + date_from: "From", + date_to: "To", + month: "Month", + year: "Year", + }, + }, + }, + }, }, })); @@ -276,6 +299,6 @@ describe("Superuser department overview", () => { const tabs = wrapper.findAll(".tabs li"); await tabs.find((tab) => tab.text() === "Pricing").trigger("click"); - expect(mocks.router.push).toHaveBeenCalledWith("/superuser/departments/1/pricing"); + expect(mocks.router.push).toHaveBeenCalledWith("/superuser/departments/1/prices"); }); });