import { expect, test } from "@playwright/test"; const entry = "/deep/nested/office/"; test("loads from a nested path without external requests", async ({ page }) => { const external: string[] = []; page.on("request", (request) => { const url = new URL(request.url()); if (url.hostname !== "127.0.0.1") external.push(request.url()); }); await page.goto(entry); await expect( page.getByRole("heading", { name: "Open an office file" }), ).toBeVisible(); await expect(page.getByText("No upload")).toBeVisible(); expect(external).toEqual([]); }); test("publishes valid relocatable metadata", async ({ request }) => { const manifestResponse = await request.get(`${entry}toolbox-app.json`); expect(manifestResponse.ok()).toBe(true); await expect(manifestResponse.json()).resolves.toMatchObject({ schemaVersion: 1, id: "de.add-ideas.office-tools", version: "0.1.0", entry: "./", icon: "./favicon.svg", privacy: { processing: "local", fileUploads: false, telemetry: false }, }); const webManifest = await request.get(`${entry}manifest.webmanifest`); expect(webManifest.ok()).toBe(true); expect(webManifest.headers()["content-type"]).toContain( "application/manifest+json", ); });