- Add vitest with solid plugin, coverage, jsdom environment - Create MSW mocks for API responses in test setup - Add unit test for ProfessionAdminListPage - Add Playwright accessibility and visual regression configs - Add sample accessibility and visual tests - Add ESLint + Prettier configs with SolidJS rules - Update scripts: test, test:coverage, test:accessibility, test:visual - Add .gitignore entries for coverage, test-results, playwright-report, .vitest - Install required dev dependencies: vitest, @solidjs/testing-library, msw, eslint, prettier, typescript, @axe-core/playwright, etc. - Create .github/workflows/ci.yml with lint, test, coverage, e2e, accessibility, visual checks This sets up full testing pipeline for admin frontend.
21 lines
875 B
TypeScript
21 lines
875 B
TypeScript
import { test, expect } from "@playwright/test";
|
|
import AxeBuilder from "@axe-core/playwright";
|
|
|
|
test.describe("Accessibility Tests", () => {
|
|
test("login page should have no accessibility violations", async ({ page }) => {
|
|
await page.goto("/admin/login");
|
|
const results = await new AxeBuilder({ page }).analyze();
|
|
expect(results.violations).toEqual([]);
|
|
});
|
|
|
|
test("dashboard page should be accessible after login", async ({ page }) => {
|
|
// Mock login (or use real credentials via env)
|
|
await page.goto("/admin/login");
|
|
await page.fill('input[type="email"]', "admin@example.com");
|
|
await page.fill('input[type="password"]', "password");
|
|
await page.click('button[type="submit"]');
|
|
await expect(page).toHaveURL("/admin");
|
|
const results = await new AxeBuilder({ page }).analyze();
|
|
expect(results.violations).toEqual([]);
|
|
});
|
|
});
|