Release Random Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 12:28:20 +02:00
parent e4aa85a503
commit 4f61d001ab
30 changed files with 1179 additions and 85 deletions
+45 -3
View File
@@ -57,7 +57,7 @@ test("runs the local draw catalogue with recipe metadata", async ({ page }) => {
await page
.getByRole("textbox", { name: "Seed", exact: true })
.fill("draw-catalogue");
await page.getByRole("tab", { name: "Draws" }).click();
await page.getByRole("button", { name: "Draws" }).click();
await page.getByLabel("Result count").fill("7");
await page.getByRole("button", { name: "Generate draw" }).click();
@@ -115,7 +115,7 @@ test("identifies normalized custom passphrase inputs without announcing output",
await page
.getByRole("textbox", { name: "Seed", exact: true })
.fill("word-list-identity");
await page.getByRole("tab", { name: "Passphrases" }).click();
await page.getByRole("button", { name: "Passphrases" }).click();
await page
.getByLabel(/Optional custom word list/u)
.fill(" alpha \n\nbeta\n gamma ");
@@ -139,6 +139,48 @@ test("identifies normalized custom passphrase inputs without announcing output",
expect(external).toEqual([]);
});
test("runs weighted draws and a local commitreveal ceremony", async ({
page,
}) => {
const external = await localOnly(page);
await page.goto("/deep/nested/rand/");
await page.getByLabel("Random source").selectOption("deterministic");
await page
.getByRole("textbox", { name: "Seed", exact: true })
.fill("weighted");
await page.getByRole("button", { name: "Lists" }).click();
await page.getByLabel("Sampling model").selectOption("weighted");
await page
.getByRole("textbox", { name: /CSV rows/u })
.fill('"Alpha, Inc",10\nBeta,2\nGamma,1');
await page.getByLabel(/Sample count/u).fill("2");
await page.getByRole("button", { name: "Draw weighted sample" }).click();
const weighted = (await page.locator(".result > pre").textContent())
?.trim()
.split("\n");
expect(weighted).toHaveLength(2);
expect(
weighted?.every((value) => ["Alpha, Inc", "Beta", "Gamma"].includes(value)),
).toBe(true);
expect(new Set(weighted).size).toBe(2);
await page.getByRole("button", { name: "Commitreveal" }).click();
await page.getByRole("button", { name: /Generate commitment/u }).click();
await expect(page.getByLabel("Public commitment")).toContainText(
/"commitment": "[A-Za-z0-9_-]{43}"/u,
);
await expect(page.getByLabel("Private reveal")).toContainText(
/"nonce": "[A-Za-z0-9_-]{43}"/u,
);
await page
.getByRole("button", { name: "Use this reveal in verifier" })
.click();
await page.getByRole("button", { name: /Verify reveals/u }).click();
await expect(page.getByText("1 reveals verified")).toBeVisible();
await expect(page.getByText(/Final Base64url seed:/u)).toBeVisible();
expect(external).toEqual([]);
});
test("serves the release identity and hardened headers", async ({
request,
}) => {
@@ -157,7 +199,7 @@ test("serves the release identity and hardened headers", async ({
const manifest = await request.get("/deep/nested/rand/toolbox-app.json");
await expect(manifest.json()).resolves.toMatchObject({
id: "de.add-ideas.rand-tools",
version: "0.1.1",
version: "0.2.0",
entry: "./",
});
});
+18
View File
@@ -0,0 +1,18 @@
import { expect, test } from "@playwright/test";
test("keeps the primary workspace inside a narrow viewport", async ({
page,
}) => {
await page.goto("/deep/nested/rand/");
await expect(page.locator("main").first()).toBeVisible();
await expect(
page.locator("main .loading, main .workbench-loading"),
).toHaveCount(0);
const widths = await page.evaluate(() => ({
content: document.documentElement.scrollWidth,
viewport: document.documentElement.clientWidth,
}));
expect(widths.viewport).toBeLessThanOrEqual(430);
expect(widths.content).toBeLessThanOrEqual(widths.viewport + 1);
});