Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions e2e/neural.spec.ts
Original file line number Diff line number Diff line change
@@ -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)
})
1 change: 1 addition & 0 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ const slug = (label: string) => label.toLowerCase().replace(/\s+/g, "-")
<li><a href="/demo">Live transliteration</a></li>
<li><a href="/maps">Map catalogue</a></li>
<li><a href="/ml">Model catalogue</a></li>
<li><a href="/neural">Neural demo</a></li>
<li><a href="/authorities">Authorities</a></li>
<li><a href="/docs">Documentation</a></li>
<li><a href="/docs/phonological-layer">Phonological layer</a></li>
Expand Down