102 lines
4.7 KiB
JavaScript
102 lines
4.7 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 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/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 department notification table changes to the admin notification E2E coverage", () => {
|
|
expect(
|
|
specsFor("src/components/displays/department/notifications/departmentNotificationsPhoneTable.vue")
|
|
).toContain("tests/e2e/admin-department-notifications.spec.ts");
|
|
expect(
|
|
specsFor("src/components/displays/pagination/models/DepartmentPos/NotificationsPhonePagination.vue")
|
|
).toContain("tests/e2e/admin-department-notifications.spec.ts");
|
|
});
|
|
|
|
it("maps limited backoffice view 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"
|
|
);
|
|
});
|
|
|
|
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/rolePermissionCatalog.js")).toContain(
|
|
"tests/e2e/superuser-roles-permissions.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("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");
|
|
});
|
|
|
|
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");
|
|
});
|
|
});
|