42 lines
1.9 KiB
JavaScript
42 lines
1.9 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 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 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("keeps full-slice ownership metadata out of broad PR smoke fallback", () => {
|
|
expect(triggersFallback("scripts/run-playwright-pr.mjs")).toBe(true);
|
|
expect(triggersFallback("scripts/run-playwright-ci-parallel.mjs")).toBe(true);
|
|
expect(triggersFallback("scripts/run-playwright-full-slice.mjs")).toBe(false);
|
|
});
|
|
});
|