TorbatYar/frontend/modules/experience/__tests__/a11y-smoke.mjs
Mortezakoohjani 0eec9f729b feat(experience): deploy Experience frontend FE-11.0-11.5 portal
Commit completed Torbat Pages admin frontend module, BFF proxy, routes, and validation artifacts for official platform deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 21:01:50 +03:30

31 lines
1.2 KiB
JavaScript

/** Accessibility smoke — design-system primitives expose expected ARIA roles/labels. */
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const DS = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "design-system");
const checks = [
{ file: "ExperienceChart.tsx", mustInclude: ['role="img"', "aria-label"] },
{ file: "ExperienceMap.tsx", mustInclude: ['role="region"', "aria-label"] },
{ file: "ExperienceTimeline.tsx", mustInclude: ['aria-label="خط زمانی"', "<time"] },
{ file: "ExperienceKanban.tsx", mustInclude: ['role="list"', "aria-label"] },
{ file: "ExperienceThemeProvider.tsx", mustInclude: ["data-experience-dir", "direction"] },
];
const errors = [];
for (const c of checks) {
const content = fs.readFileSync(path.join(DS, c.file), "utf8");
for (const needle of c.mustInclude) {
if (!content.includes(needle)) {
errors.push(`${c.file}: missing ${needle}`);
}
}
}
if (errors.length) {
console.error("Experience a11y smoke failed:\n" + errors.map((e) => " - " + e).join("\n"));
process.exit(1);
}
console.log("experience a11y-smoke OK");