quality / commitlint (push) Skipped
quality / changes (push) Failing after 8s
quality / openapi (push) Skipped
quality / web (push) Skipped
quality / api (push) Skipped
CD / quality (push) Failing after 9s
quality / docker-check (push) Skipped
CD / publish (push) Skipped
- genReqId (uuid) + x-request-id в каждом ответе и request_id в error envelope — корреляция ошибок между клиентом и логами - RBAC: /agents/:id/(stats|blocked-ips|blocked-ports) классифицируются как fw:stats:read (reset остаётся под fw:agents:write) - web: test-скрипт + 10 unit-тестов (filter-utils, fleet-kpis, parseClaims, nav) - typecheck-скрипты для api/shared/db; CI: тесты shared и web, typecheck всех пакетов - гигиена: .node-version (22), актуальный .dockerignore, drizzle out → ./migrations, удалены 12 лишних .gitkeep и пустой apps/api/test
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { NAV_ITEMS, NAV_SECTIONS, navLabel, navParentForDetail } from './nav'
|
|
|
|
describe('nav config', () => {
|
|
it('every nav item has label, icon, keywords and a known section', () => {
|
|
const sectionIds = new Set(NAV_SECTIONS.map((s) => s.id))
|
|
for (const item of NAV_ITEMS) {
|
|
expect(item.label.length).toBeGreaterThan(0)
|
|
expect(item.keywords.length).toBeGreaterThan(0)
|
|
expect(sectionIds.has(item.section)).toBe(true)
|
|
}
|
|
})
|
|
|
|
it('navLabel resolves known routes', () => {
|
|
expect(navLabel('/')).toBe('Панель управления')
|
|
expect(navLabel('/agents')).toBe('Агенты')
|
|
expect(navLabel('/nope')).toBeUndefined()
|
|
})
|
|
|
|
it('navParentForDetail maps detail routes to parents', () => {
|
|
expect(navParentForDetail('/agents/abc')).toBe('/agents')
|
|
expect(navParentForDetail('/lists/abc')).toBe('/lists')
|
|
expect(navParentForDetail('/rules/set-1')).toBe('/rules')
|
|
expect(navParentForDetail('/settings')).toBeUndefined()
|
|
expect(navParentForDetail('/agents/abc/preview')).toBeUndefined()
|
|
})
|
|
})
|