From 95d09d3cb4d2bea14afe025e25bdf2d2c12972ca Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 2 Sep 2026 16:47:22 +0200 Subject: [PATCH] feat: /neural in nav + Playwright plumbing spec (TODO.publish-client 09) --- e2e/neural.spec.ts | 23 +++++++++++++++++++++++ src/layouts/Base.astro | 1 + 2 files changed, 24 insertions(+) create mode 100644 e2e/neural.spec.ts diff --git a/e2e/neural.spec.ts b/e2e/neural.spec.ts new file mode 100644 index 0000000..e454f33 --- /dev/null +++ b/e2e/neural.spec.ts @@ -0,0 +1,23 @@ +// /neural demo — plumbing assertions (no model download: UI + error surfaces). +import { expect, test } from "@playwright/test" + +test("neural demo renders controls and surfaces errors with causes", async ({ page }) => { + await page.goto("/neural") + await expect(page.getByRole("heading", { name: "Neural models demo" })).toBeVisible() + await expect(page.locator("#model")).toHaveValue(/ara-diac-small/) + await expect(page.locator("#run")).toBeEnabled() + // An unknown model id yields a RegistryError surfaced with its cause chain. + await page.selectOption("#model", "ara-diac-small-2.0-int8") + await page.evaluate(() => { + const s = document.getElementById("model")! as HTMLSelectElement + s.value = "nope-9.9" + }) + await page.click("#run") + await expect(page.locator("#output")).toContainText(/unknown model id|Error/, { timeout: 60_000 }) +}) + +test("clear-cache reports state", async ({ page }) => { + await page.goto("/neural") + await page.click("#clear-cache") + await expect(page.locator("#confidence")).toContainText(/cleared/i) +}) diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index f388bc2..8d6c696 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -274,6 +274,7 @@ const slug = (label: string) => label.toLowerCase().replace(/\s+/g, "-")
  • Live transliteration
  • Map catalogue
  • Model catalogue
  • +
  • Neural demo
  • Authorities
  • Documentation
  • Phonological layer