Skip to content

Commit 95d09d3

Browse files
committed
feat: /neural in nav + Playwright plumbing spec (TODO.publish-client 09)
1 parent d836a90 commit 95d09d3

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

e2e/neural.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// /neural demo — plumbing assertions (no model download: UI + error surfaces).
2+
import { expect, test } from "@playwright/test"
3+
4+
test("neural demo renders controls and surfaces errors with causes", async ({ page }) => {
5+
await page.goto("/neural")
6+
await expect(page.getByRole("heading", { name: "Neural models demo" })).toBeVisible()
7+
await expect(page.locator("#model")).toHaveValue(/ara-diac-small/)
8+
await expect(page.locator("#run")).toBeEnabled()
9+
// An unknown model id yields a RegistryError surfaced with its cause chain.
10+
await page.selectOption("#model", "ara-diac-small-2.0-int8")
11+
await page.evaluate(() => {
12+
const s = document.getElementById("model")! as HTMLSelectElement
13+
s.value = "nope-9.9"
14+
})
15+
await page.click("#run")
16+
await expect(page.locator("#output")).toContainText(/unknown model id|Error/, { timeout: 60_000 })
17+
})
18+
19+
test("clear-cache reports state", async ({ page }) => {
20+
await page.goto("/neural")
21+
await page.click("#clear-cache")
22+
await expect(page.locator("#confidence")).toContainText(/cleared/i)
23+
})

src/layouts/Base.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ const slug = (label: string) => label.toLowerCase().replace(/\s+/g, "-")
274274
<li><a href="/demo">Live transliteration</a></li>
275275
<li><a href="/maps">Map catalogue</a></li>
276276
<li><a href="/ml">Model catalogue</a></li>
277+
<li><a href="/neural">Neural demo</a></li>
277278
<li><a href="/authorities">Authorities</a></li>
278279
<li><a href="/docs">Documentation</a></li>
279280
<li><a href="/docs/phonological-layer">Phonological layer</a></li>

0 commit comments

Comments
 (0)