@@ -1,5 +1,6 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { Buffer } from "node:buffer";
|
||||
import { strToU8, zipSync } from "fflate";
|
||||
|
||||
for (const path of ["/", "/deep/nested/repro/"]) {
|
||||
test(`builds a manifest locally at ${path}`, async ({ page }) => {
|
||||
@@ -57,3 +58,38 @@ test("keeps the installed application available offline", async ({
|
||||
await context.setOffline(false);
|
||||
}
|
||||
});
|
||||
|
||||
test("compares expanded ZIP evidence and recognizes CycloneDX locally", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
const zip = zipSync({ "inside.txt": strToU8("same content") });
|
||||
await page.locator('input[accept="application/zip,.zip"]').setInputFiles({
|
||||
name: "sample.zip",
|
||||
mimeType: "application/zip",
|
||||
buffer: Buffer.from(zip),
|
||||
});
|
||||
await expect(page.getByLabel("Archive content manifest")).toHaveValue(
|
||||
/inside\.txt/u,
|
||||
);
|
||||
|
||||
await page
|
||||
.locator('input[type="file"]')
|
||||
.first()
|
||||
.setInputFiles({
|
||||
name: "bom.cdx.json",
|
||||
mimeType: "application/json",
|
||||
buffer: Buffer.from(
|
||||
JSON.stringify({
|
||||
bomFormat: "CycloneDX",
|
||||
specVersion: "1.6",
|
||||
components: [{ name: "demo" }],
|
||||
}),
|
||||
),
|
||||
});
|
||||
await page.getByRole("button", { name: "Build manifest" }).click();
|
||||
await page.getByRole("button", { name: "Build provenance evidence" }).click();
|
||||
await expect(
|
||||
page.getByRole("cell", { name: "CycloneDX JSON" }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user