mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-07 13:03:20 -05:00
The word "Memory" named collections of documents, notes about the person, and RAM in the same navigation. Collections are now Knowledge: the sidebar item, the page title and text, the Home action, the agent form section and the chat tool group. The tool group "Memory and profile changes" is now "Suggested changes", since it is the generic ask-first mechanism for notes, rules, skills, pages and the dashboard. The Settings section "Memory and models" is now "Models in memory". Only display strings change. Ids, routes, locale keys, group ids, grants and stored data stay as they are. All nine locales are updated; the docs name the Knowledge page and say which search the default engine does. Assisted-by: Claude:claude-sonnet-5-5
60 lines
2.8 KiB
JavaScript
60 lines
2.8 KiB
JavaScript
import { test, expect } from './coverage-fixtures.js'
|
|
|
|
// The Skills page has an item of its own in the sidebar, right after Knowledge.
|
|
// Skills work in every chat, so Agents does not light up on the page.
|
|
|
|
const item = (page, href) => page.locator(`.sidebar-nav a.nav-item[href="${href}"]`)
|
|
|
|
test.describe('Skills in the sidebar', () => {
|
|
test('the item follows Knowledge, opens the page and is the only one lit up', async ({ page }) => {
|
|
await page.goto('/app')
|
|
await expect(item(page, '/app/skills')).toBeVisible()
|
|
const hrefs = await page.locator('.sidebar-nav a.nav-item').evaluateAll(els => els.map(e => e.getAttribute('href')))
|
|
expect(hrefs[hrefs.indexOf('/app/collections') + 1]).toBe('/app/skills')
|
|
await expect(item(page, '/app/skills').locator('.nav-label')).toHaveText('Skills')
|
|
await item(page, '/app/skills').click()
|
|
await expect(page).toHaveURL(/\/app\/skills$/)
|
|
await expect(page.getByTestId('skills-page')).toBeVisible()
|
|
await expect(item(page, '/app/skills')).toHaveClass(/active/)
|
|
await expect(item(page, '/app/agents')).not.toHaveClass(/active/)
|
|
await expect(item(page, '/app/collections')).not.toHaveClass(/active/)
|
|
})
|
|
|
|
test('Agents is not lit up on any skills page, and Skills is', async ({ page }) => {
|
|
for (const path of ['/app/skills', '/app/skills/new']) {
|
|
await page.goto(path)
|
|
await expect(item(page, '/app/skills')).toHaveClass(/active/)
|
|
await expect(item(page, '/app/agents')).not.toHaveClass(/active/)
|
|
}
|
|
})
|
|
|
|
test('the page says what skills are and that every chat can use them', async ({ page }) => {
|
|
await page.goto('/app/skills')
|
|
await expect(page.locator('.page-header')).toContainText('all your chats')
|
|
})
|
|
|
|
test('the page loads without console errors', async ({ page }) => {
|
|
const errors = []
|
|
page.on('pageerror', e => errors.push(e.message))
|
|
page.on('console', m => { if (m.type() === 'error' && !/Failed to load resource/.test(m.text())) errors.push(m.text()) })
|
|
await page.goto('/app/skills')
|
|
await expect(page.getByTestId('skills-page')).toBeVisible()
|
|
expect(errors).toEqual([])
|
|
})
|
|
})
|
|
|
|
test.describe('Skills in the sidebar on a phone', () => {
|
|
test.use({ viewport: { width: 390, height: 844 } })
|
|
|
|
test('the menu lists Skills after Knowledge and opens the page', async ({ page }) => {
|
|
await page.goto('/app')
|
|
await page.getByRole('button', { name: 'Open menu' }).click()
|
|
await expect(item(page, '/app/skills')).toBeVisible()
|
|
const hrefs = await page.locator('.sidebar-nav a.nav-item').evaluateAll(els => els.map(e => e.getAttribute('href')))
|
|
expect(hrefs[hrefs.indexOf('/app/collections') + 1]).toBe('/app/skills')
|
|
await item(page, '/app/skills').click()
|
|
await expect(page).toHaveURL(/\/app\/skills$/)
|
|
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true)
|
|
})
|
|
})
|