test(ui): read the server address in the add-node spec from the page

The spec expected the register address to carry port 8089, so it failed
on any other port. It now expects the origin the page was opened from.

Assisted-by: Claude Code:claude-sonnet-5-5 node
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto committed 2026-10-21 00:59:54 +00:00
1 parent 2f46931ad5
commit 48634619c1
1 file changed
+1 -1
+1 -1
View File
@@ -13,7 +13,7 @@ test.describe('Add a node', () => {
await page.goto('/app/nodes/add')
await expect(page.getByRole('heading', { name: 'Add a node' })).toBeVisible({ timeout: 15_000 })
await expect(page.getByRole('radio', { name: 'Registered worker' })).toHaveAttribute('aria-checked', 'true')
await expect(command(page)).toContainText('LOCALAI_REGISTER_TO="http://127.0.0.1:8089"')
await expect(command(page)).toContainText(`LOCALAI_REGISTER_TO="${new URL(page.url()).origin}"`)
await expect(command(page)).toContainText('LOCALAI_REGISTRATION_TOKEN="$TOKEN"')
await expect(command(page)).toContainText('localai/localai:latest-cpu worker')
await expect(page.getByText('This page never shows it.')).toBeVisible()