mirror of
https://github.com/mudler/LocalAI.git
synced 2026-10-28 09:08:54 -04:00
test(ui): turn the feature switches on in the navigation specs (#12895)
The sidebar and the Build overview show the Add-ons and Fine-tuning entries only when the server reports those switches on. With no add-on owner running, the server reports the add-ons switch off, and the test server has the fine-tuning switch off, so the two specs failed on master. The two tests are about those entries being shown, so they set the switches on and keep the server's other flags. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
1 parent
51954f6f1b
commit
e1125c8aea
1 file changed
+7
@@ -1,4 +1,5 @@
|
||||
import { test, expect } from './coverage-fixtures.js'
|
||||
import { stubAddonRoutes } from './addons-fixtures.js'
|
||||
|
||||
test.describe('Navigation', () => {
|
||||
test('/ redirects to /app', async ({ page }) => {
|
||||
@@ -21,6 +22,7 @@ test.describe('Navigation', () => {
|
||||
})
|
||||
|
||||
test('the sidebar has Chat, Models and Add-ons, no Settings and no Create tier', async ({ page }) => {
|
||||
await stubAddonRoutes(page)
|
||||
await page.goto('/app')
|
||||
await expect(page.locator('.sidebar-section-title', { hasText: 'Create' })).toHaveCount(0)
|
||||
for (const href of ['/app/chat', '/app/models', '/app/addons']) {
|
||||
@@ -81,6 +83,11 @@ test.describe('Navigation', () => {
|
||||
})
|
||||
|
||||
test('the Build overview lists the tools with a line each', async ({ page }) => {
|
||||
// The Fine-tuning tile is shown when the server has the switch on.
|
||||
await page.route('**/api/features', async route => {
|
||||
const real = await (await route.fetch()).json()
|
||||
return route.fulfill({ json: { ...real, fine_tuning: true } })
|
||||
})
|
||||
await page.goto('/app/build')
|
||||
const list = page.getByRole('list', { name: 'Build tools' })
|
||||
// Each tool is a row with its sentence and an Open link.
|
||||
|
||||
Reference in new issue
Block a user