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

This commit is contained in:
2026-09-02 04:43:16 +02:00
parent a1380cfba2
commit 46fc10f745
37 changed files with 2722 additions and 455 deletions
+51 -6
View File
@@ -25,7 +25,9 @@ function auditPage(page: Page) {
async function openApp(page: Page) {
await page.goto(APP_PATH);
await expect(
page.getByRole("heading", { name: "Diff Tools", exact: true }),
page
.locator(".hero")
.getByRole("heading", { name: "Diff Tools", exact: true }),
).toBeVisible();
await expect(page.getByText(/substantive change row/u)).toBeVisible();
}
@@ -60,19 +62,19 @@ test("exports exact-decimal JSON Patch without losing the prior result", async (
}) => {
const audit = auditPage(page);
await openApp(page);
await page.getByRole("tab", { name: /JSON Semantic/u }).click();
await page.getByRole("button", { name: /JSON Semantic/u }).click();
await page.getByTestId("left-editor").fill('{"amount":1,"keep":true}');
await page
.getByTestId("right-editor")
.fill('{"amount":9007199254740993123456789,"keep":true}');
await page.getByRole("button", { name: "Compare now" }).click();
await expect(page.getByText(/1 substantive change row/u)).toBeVisible();
await page.getByRole("tab", { name: "Patches" }).click();
await page.getByRole("button", { name: "Patches" }).click();
await expect(page.getByTestId("json-patch")).toContainText(
"9007199254740993123456789",
);
await page.getByRole("tab", { name: /XML Namespace-aware/u }).click();
await page.getByRole("button", { name: /XML Namespace-aware/u }).click();
await expect(page.getByText(/substantive change row/u)).toBeVisible();
const previousVerdict = page.getByText("Different", { exact: true }).first();
await expect(previousVerdict).toBeVisible();
@@ -87,7 +89,7 @@ test("exports exact-decimal JSON Patch without losing the prior result", async (
test("opens local keyed CSV and reports duplicate keys", async ({ page }) => {
const audit = auditPage(page);
await openApp(page);
await page.getByRole("tab", { name: /CSV \/ TSV Keyed rows/u }).click();
await page.getByRole("button", { name: /CSV \/ TSV Keyed rows/u }).click();
await page.getByTestId("left-file-input").setInputFiles({
name: "duplicates.csv",
mimeType: "text/csv",
@@ -118,8 +120,51 @@ test("serves the release identity and hardened headers", async ({
const manifest = await request.get(`${APP_PATH}toolbox-app.json`);
await expect(manifest.json()).resolves.toMatchObject({
id: "de.add-ideas.diff-tools",
version: "0.1.0",
version: "0.2.0",
entry: "./",
privacy: { processing: "local", fileUploads: true, telemetry: false },
});
});
test("runs the bounded three-way merge workspace", async ({ page }) => {
await page.goto("/deep/nested/diff/");
await page.getByRole("button", { name: "Three-way merge" }).click();
await page.getByLabel("Base").fill("one\ntwo\nthree\n");
await page.getByLabel("Ours").fill("ONE\ntwo\nthree\n");
await page.getByLabel("Theirs").fill("one\ntwo\nTHREE\n");
await page.getByRole("button", { name: "Merge locally" }).click();
await expect(page.getByTestId("merge-output")).toHaveValue(
"ONE\ntwo\nTHREE\n",
);
await expect(
page.getByRole("heading", { name: "0 conflict(s)" }),
).toBeVisible();
});
test("imports and compares portable directory manifests", async ({ page }) => {
await page.goto("/deep/nested/diff/");
await page.getByRole("button", { name: "Directories" }).click();
const manifest = (digest: string) => ({
schema: "de.add-ideas.diff-tools.directory-manifest.v1",
schemaVersion: 1,
generatedLocally: true,
hashAlgorithm: "SHA-256",
entries: [{ path: "file.txt", bytes: 4, sha256: digest }],
totals: { files: 1, bytes: 4 },
});
const inputs = page.locator('input[accept*="application/json"]');
await inputs.nth(0).setInputFiles({
name: "left.json",
mimeType: "application/json",
buffer: Buffer.from(JSON.stringify(manifest("a".repeat(64)))),
});
await inputs.nth(1).setInputFiles({
name: "right.json",
mimeType: "application/json",
buffer: Buffer.from(JSON.stringify(manifest("b".repeat(64)))),
});
await page.getByRole("button", { name: "Build & compare manifests" }).click();
await expect(
page.getByRole("row", { name: /file\.txt modified/iu }),
).toBeVisible();
});