LocalAI/core/http/react-ui/e2e/navigation.spec.js
Ettore Di Giacinto aea21951a2
feat: add users and authentication support (#9061)
* feat(ui): add users and authentication support

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat: allow the admin user to impersonificate users

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore: ui improvements, disable 'Users' button in navbar when no auth is configured

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat: add OIDC support

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix: gate models

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore: cache requests to optimize speed

Signed-off-by: Ettore Di Giacinto <[email protected]>

* small UI enhancements

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore(ui): style improvements

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix: cover other paths by auth

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore: separate local auth, refactor

Signed-off-by: Ettore Di Giacinto <[email protected]>

* security hardening, approval mode

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix: fix tests and expectations

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore: update localagi/localrecall

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2026-03-19 21:40:51 +01:00

23 lines
828 B
JavaScript

import { test, expect } from '@playwright/test'
test.describe('Navigation', () => {
test('/ redirects to /app', async ({ page }) => {
await page.goto('/')
await expect(page).toHaveURL(/\/app/)
})
test('/app shows home page with LocalAI title', async ({ page }) => {
await page.goto('/app')
await expect(page.locator('.sidebar')).toBeVisible()
await expect(page.locator('.home-page')).toBeVisible()
})
test('sidebar traces link navigates to /app/traces', async ({ page }) => {
await page.goto('/app')
const tracesLink = page.locator('a.nav-item[href="/app/traces"]')
await expect(tracesLink).toBeVisible()
await tracesLink.click()
await expect(page).toHaveURL(/\/app\/traces/)
await expect(page.getByRole('heading', { name: 'Traces', exact: true })).toBeVisible()
})
})