Resolve direct-order product reconciliation context, preserve valid selections when restricted products are activated, remove the redundant certificate request, and add focused regression coverage.
223 lines
11 KiB
JavaScript
223 lines
11 KiB
JavaScript
import { describe, expect, it } from "vitest";
|
|
import { fallbackChangePatterns, sourceMappings } from "../../scripts/playwright-pr-mapping.mjs";
|
|
|
|
const specsFor = (file) =>
|
|
sourceMappings
|
|
.filter((mapping) => mapping.patterns.some((pattern) => pattern.test(file)))
|
|
.flatMap((mapping) => mapping.specs);
|
|
|
|
describe("Playwright PR mapping", () => {
|
|
const triggersFallback = (file) => fallbackChangePatterns.some((pattern) => pattern.test(file));
|
|
|
|
it("maps user vehicle table changes to the user vehicles E2E coverage", () => {
|
|
expect(specsFor("src/components/displays/user/vehicles/vehiclesTable.vue")).toContain(
|
|
"tests/e2e/userVehicles.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps shared order filter changes to admin and superuser coverage", () => {
|
|
for (const sourceFile of [
|
|
"src/components/displays/pagination/models/DepartmentPos/OrdersPagination.vue",
|
|
"src/components/displays/pagination/models/SuperUserDashboard/InvoiceOrdersPagination.vue",
|
|
"src/components/displays/buttons/DatePeriodSelector.vue",
|
|
"src/services/orderDateEvents.js",
|
|
"src/services/relativeDateShortcuts.js",
|
|
"src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPosOrders.vue",
|
|
"src/views/dashboards/departmentDashboard/modules/Pos/DepartmentPosDrafts.vue",
|
|
]) {
|
|
const specs = specsFor(sourceFile);
|
|
|
|
expect(specs).toContain("tests/e2e/admin-pos-order-filters.spec.ts");
|
|
expect(specs).toContain("tests/e2e/superuser-orders-date-filters.spec.ts");
|
|
}
|
|
});
|
|
|
|
it("maps superuser department pricing changes to custom-only pricing coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/department/DepartmentPricing.vue")).toContain(
|
|
"tests/e2e/superuser-department-pricing-custom-only.spec.ts"
|
|
);
|
|
expect(
|
|
specsFor("src/views/dashboards/superUserDashboard/department/SuperUserSelectedDepartmentObject.vue")
|
|
).toContain("tests/e2e/superuser-department-pricing-custom-only.spec.ts");
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/department/DepartmentCustomerPricing.vue")).toContain(
|
|
"tests/e2e/superuser-department-pricing-custom-only.spec.ts"
|
|
);
|
|
expect(specsFor("src/components/displays/department/pricing/DepartmentCustomerPricingEditor.vue")).toContain(
|
|
"tests/e2e/superuser-department-pricing-custom-only.spec.ts"
|
|
);
|
|
expect(specsFor("src/services/departmentCustomerPricing.js")).toContain(
|
|
"tests/e2e/superuser-department-pricing-custom-only.spec.ts"
|
|
);
|
|
expect(specsFor("src/components/session/token/SessionUser/Objects/Departments.vue")).toContain(
|
|
"tests/e2e/superuser-department-pricing-custom-only.spec.ts"
|
|
);
|
|
expect(specsFor("src/components/session/token/SessionUser/Objects/Departments.vue")).not.toContain(
|
|
"tests/e2e/userAuth.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps superuser department shell changes to the department shell Playwright coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/department/DepartmentProfile.vue")).toContain(
|
|
"tests/e2e/superuser-department-shells.spec.js"
|
|
);
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/department/modules/DepartmentModulesSetup.vue")).toContain(
|
|
"tests/e2e/superuser-department-shells.spec.js"
|
|
);
|
|
expect(
|
|
specsFor("src/views/dashboards/superUserDashboard/department/stripe/DepartmentStripeTerminalsReaders.vue")
|
|
).toContain("tests/e2e/superuser-department-shells.spec.js");
|
|
});
|
|
|
|
it("maps superuser department employee changes to department employee coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/department/DepartmentEmployees.vue")).toContain(
|
|
"tests/e2e/superuser-department-employees.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/backoffice/components/LimitedBackofficeEmployeesManager.vue")).toContain(
|
|
"tests/e2e/superuser-department-employees.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/backoffice/components/LimitedBackofficeEmployeesManager.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
expect(
|
|
specsFor("src/views/dashboards/superUserDashboard/department/SuperUserDashboardDepartmentNavigation.vue")
|
|
).toContain("tests/e2e/superuser-department-employees.spec.ts");
|
|
});
|
|
|
|
it("maps department notification table changes to the admin notification E2E coverage", () => {
|
|
const notificationPaginationSpecs = specsFor(
|
|
"src/components/displays/pagination/models/DepartmentPos/NotificationsPhonePagination.vue"
|
|
);
|
|
|
|
expect(
|
|
specsFor("src/views/dashboards/departmentDashboard/modules/notifications/DepartmentNotifications.vue")
|
|
).toContain("tests/e2e/admin-department-notifications.spec.ts");
|
|
expect(
|
|
specsFor("src/components/displays/department/notifications/departmentNotificationsPhoneTable.vue")
|
|
).toContain("tests/e2e/admin-department-notifications.spec.ts");
|
|
expect(notificationPaginationSpecs).toContain("tests/e2e/admin-department-notifications.spec.ts");
|
|
expect(notificationPaginationSpecs).not.toContain("tests/e2e/pos-flow.spec.js");
|
|
expect(notificationPaginationSpecs).not.toContain("tests/e2e/pos-mobile-order-flow.spec.js");
|
|
expect(notificationPaginationSpecs).not.toContain("tests/e2e/admin-pos-orders.spec.ts");
|
|
});
|
|
|
|
it("maps admin daily-report changes to daily-report E2E coverage", () => {
|
|
expect(
|
|
specsFor(
|
|
"src/views/dashboards/departmentDashboard/modules/daily-report/displays/DepartmentDashboardDailyReportProductSales.vue"
|
|
)
|
|
).toContain("tests/e2e/admin-daily-report.spec.ts");
|
|
expect(specsFor("src/components/session/token/SessionUser/Objects/DepartmentDailyReports.vue")).toContain(
|
|
"tests/e2e/admin-daily-report.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps limited backoffice view and service changes to limited backoffice E2E coverage", () => {
|
|
expect(specsFor("src/views/backoffice/LimitedBackofficePrices.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/backoffice/components/LimitedBackofficeLayout.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/backoffice/LimitedBackofficeCustomerPricing.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
expect(specsFor("src/components/displays/department/pricing/DepartmentCustomerPricingEditor.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
expect(specsFor("src/services/limitedBackoffice.js")).toContain("tests/e2e/limited-backoffice.spec.ts");
|
|
expect(specsFor("src/services/departmentCustomerPricing.js")).toContain("tests/e2e/limited-backoffice.spec.ts");
|
|
});
|
|
|
|
it("maps superuser role permission page changes to role permissions E2E coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/roles/SuperUserRolesPermissions.vue")).toContain(
|
|
"tests/e2e/superuser-roles-permissions.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/roles/RolePermissionManager.vue")).toContain(
|
|
"tests/e2e/superuser-roles-permissions.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/roles/rolePermissionCatalog.js")).toContain(
|
|
"tests/e2e/superuser-roles-permissions.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps superuser user detail changes to the superuser users E2E coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/user/User.vue")).toContain(
|
|
"tests/e2e/superuser-users.spec.ts"
|
|
);
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/user/UserSecurity.vue")).toContain(
|
|
"tests/e2e/superuser-users.spec.ts"
|
|
);
|
|
expect(
|
|
specsFor("src/views/dashboards/superUserDashboard/user/displays/other/UserOtherSpecialArrangement.vue")
|
|
).toContain("tests/e2e/superuser-users.spec.ts");
|
|
});
|
|
|
|
it("maps superuser dashboard shell changes to system status E2E coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/SuperUserDashboardNavigation.vue")).toContain(
|
|
"tests/e2e/superuser-system-status.smoke.spec.js"
|
|
);
|
|
expect(specsFor("src/components/displays/superuser/system/SystemStatusDashboard.vue")).toContain(
|
|
"tests/e2e/superuser-system-status.smoke.spec.js"
|
|
);
|
|
});
|
|
|
|
it("maps superuser security changes to security E2E coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/system/SystemSecurity.vue")).toContain(
|
|
"tests/e2e/superuser-security.spec.ts"
|
|
);
|
|
expect(specsFor("src/services/superuserSecurity.js")).toContain("tests/e2e/superuser-security.spec.ts");
|
|
});
|
|
|
|
it("keeps PR runner and full-slice metadata edits out of broad PR smoke fallback", () => {
|
|
expect(triggersFallback("scripts/run-playwright-pr.mjs")).toBe(false);
|
|
expect(triggersFallback("scripts/run-playwright-ci-parallel.mjs")).toBe(true);
|
|
expect(triggersFallback("scripts/run-playwright-full-slice.mjs")).toBe(false);
|
|
});
|
|
|
|
it("maps customer product rule changes to POS customer rule E2E coverage", () => {
|
|
expect(specsFor("src/features/customer/customerProductRules.js")).toContain("tests/e2e/pos-customer-rules.spec.js");
|
|
expect(specsFor("src/components/displays/boxes/ProductBox.vue")).toContain("tests/e2e/pos-customer-rules.spec.js");
|
|
expect(specsFor("src/components/shop/POSDepartmentProcess.vue")).toContain("tests/e2e/admin-pos-orders.spec.ts");
|
|
});
|
|
|
|
it("maps the shared POS product selector to POS and booking customer-rule coverage", () => {
|
|
const specs = specsFor("src/components/forms/department/pos/SelectProductsFormPOS.vue");
|
|
const mapping = sourceMappings.find((candidate) => candidate.name === "shared-pos-product-selection");
|
|
|
|
expect(specs).toContain("tests/e2e/pos-customer-rules.spec.js");
|
|
expect(specs).toContain("tests/e2e/userBookWash.spec.ts");
|
|
expect(mapping?.projects).toEqual(["chromium-desktop", "chromium-mobile"]);
|
|
});
|
|
|
|
it("maps global customer rule configuration changes to its editor coverage", () => {
|
|
expect(specsFor("src/views/dashboards/superUserDashboard/CustomerRuleProductRestrictions.vue")).toContain(
|
|
"tests/e2e/superuser-customer-rules.spec.ts"
|
|
);
|
|
expect(specsFor("src/features/customer/customerRuleProductRestrictionService.js")).toContain(
|
|
"tests/e2e/superuser-customer-rules.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps limited backoffice changes to the limited backoffice E2E coverage", () => {
|
|
expect(specsFor("src/views/backoffice/LimitedBackofficeEmployees.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps header navigation changes to limited backoffice E2E coverage", () => {
|
|
expect(specsFor("src/components/viewport/page/headers/HeaderAccessShortcuts.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
expect(specsFor("src/components/models/navigation/items/NavigationMenuItemsGlobal.vue")).toContain(
|
|
"tests/e2e/limited-backoffice.spec.ts"
|
|
);
|
|
});
|
|
|
|
it("maps e-conomic customer identifier changes to POS customer registration E2E coverage", () => {
|
|
const specs = specsFor("src/services/economicCustomerIdentifiers.js");
|
|
|
|
expect(specs).toContain("tests/e2e/pos-flow.spec.js");
|
|
expect(specs).toContain("tests/e2e/pos-mobile-order-flow.spec.js");
|
|
});
|
|
});
|