@@ -1,4 +1,5 @@
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
import { Buffer } from "node:buffer";
|
||||
|
||||
const ORIGIN = "http://127.0.0.1:4173";
|
||||
async function localOnly(page: Page) {
|
||||
@@ -43,6 +44,35 @@ test("applies the visible text pipeline and preserves its last output", async ({
|
||||
expect(external).toEqual([]);
|
||||
});
|
||||
|
||||
test("shows byte evidence and composes an added literal transform", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/deep/nested/text/");
|
||||
await page.getByLabel("Decode as").selectOption("utf-8");
|
||||
await page.locator('input[type="file"]').setInputFiles({
|
||||
name: "bom.txt",
|
||||
mimeType: "text/plain",
|
||||
buffer: Buffer.from([0xef, 0xbb, 0xbf, ...Buffer.from("old\r\nold")]),
|
||||
});
|
||||
await page.getByText("Byte decoding evidence").click();
|
||||
await expect(page.getByText("utf-8 / utf-8")).toBeVisible();
|
||||
await expect(
|
||||
page
|
||||
.locator("details")
|
||||
.filter({ hasText: "Byte decoding evidence" })
|
||||
.getByText("1 / 0 / 0", { exact: true }),
|
||||
).toBeVisible();
|
||||
await page.getByLabel("New transformation").selectOption("replace-literal");
|
||||
await page.getByRole("button", { name: "Add step" }).click();
|
||||
await page.getByLabel("Literal search text").fill("old");
|
||||
await page.getByLabel("Literal replacement text").fill("new");
|
||||
await page.getByRole("button", { name: "Apply pipeline" }).click();
|
||||
await expect(page.getByLabel("Transformed output")).toHaveValue("new");
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Export artifact + evidence" }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("serves the release identity and hardened headers", async ({
|
||||
request,
|
||||
}) => {
|
||||
@@ -55,7 +85,7 @@ test("serves the release identity and hardened headers", async ({
|
||||
const manifest = await request.get("/deep/nested/text/toolbox-app.json");
|
||||
await expect(manifest.json()).resolves.toMatchObject({
|
||||
id: "de.add-ideas.text-tools",
|
||||
version: "0.1.0",
|
||||
version: "0.2.0",
|
||||
entry: "./",
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user