29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
const assets = [
|
|
["favicon.svg", /image\/svg\+xml/i],
|
|
["favicon.ico", /image\/(x-icon|vnd\.microsoft\.icon)/i],
|
|
["apple-touch-icon.png", /image\/png/i],
|
|
["eventlens-icon-192.png", /image\/png/i],
|
|
["eventlens-icon-512.png", /image\/png/i],
|
|
["site.webmanifest", /(manifest|json)/i],
|
|
] as const;
|
|
|
|
test("canonical EventLens branding and icon package are locally served", async ({ page, request }) => {
|
|
await page.goto("/#analysis");
|
|
await expect(page).toHaveTitle("EventLens — Windows Incident Reconstruction");
|
|
await expect(page.locator('meta[name="application-name"]')).toHaveAttribute("content", "EventLens");
|
|
await expect(page.locator('link[rel="manifest"]')).toHaveAttribute("href", "/site.webmanifest");
|
|
await expect(page.locator(".event-logo svg")).toBeVisible();
|
|
|
|
for (const [asset, contentType] of assets) {
|
|
const response = await request.get(`/${asset}`);
|
|
expect(response.status(), `${asset} should be served`).toBe(200);
|
|
expect(response.headers()["content-type"] ?? "", `${asset} MIME type`).toMatch(contentType);
|
|
}
|
|
|
|
for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) {
|
|
await expect(page.getByRole("button", { name: workspace, exact: false }).first().locator("svg")).toHaveCount(1);
|
|
}
|
|
});
|