@@ -35,3 +35,31 @@ test("keeps the installed application available offline", async ({
|
||||
await context.setOffline(false);
|
||||
}
|
||||
});
|
||||
|
||||
test("edits, interprets and searches a larger buffer in a bounded worker", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
await page.locator('input[type="file"]').evaluate((input) => {
|
||||
const bytes = new Uint8Array(70_000);
|
||||
bytes.fill(0x41);
|
||||
bytes[69_999] = 0x42;
|
||||
const transfer = new DataTransfer();
|
||||
transfer.items.add(
|
||||
new File([bytes], "large.bin", { type: "application/octet-stream" }),
|
||||
);
|
||||
(input as HTMLInputElement).files = transfer.files;
|
||||
input.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
});
|
||||
await page
|
||||
.getByRole("textbox", { name: "Pattern", exact: true })
|
||||
.fill("41 41 42");
|
||||
await page.getByRole("button", { name: "Search", exact: true }).click();
|
||||
await expect(page.getByRole("status")).toContainText("1 match");
|
||||
await page.getByLabel("Replacement bytes (hex)").fill("ff");
|
||||
await page.getByRole("button", { name: "Apply byte edit" }).click();
|
||||
await expect(page.getByLabel("hex output")).toHaveValue(/^ff/u);
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Typed interpretations" }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user