Files
hermes-web-ui/tests/server/api-docs-controller.test.ts
ekko 83e37bac02 feat: add outbound relay and MCU login flow (#1580)
* add global agent chat relay

* add model run MCP auth

* avoid codex prompt inflation

* guide codex to use hermes lan tools

* truncate long tool call previews

* write codex MCP env inline

* log codex developer prompt

* remove codex prompt debug logging

* fix codex chat tool history

* log codex chat proxy requests

* write codex proxy debug to server log

* log codex upstream tool requests

* expand codex mcp namespaces for custom providers

* remove codex proxy debug logging

* add hermes mcp openapi relay

* fix: improve mcp docs and chat run cleanup

* feat: add mcu relay login flow

* fix ci test expectations

* fix group chat deeplink e2e expectation

---------

Co-authored-by: Codex <codex@openai.com>
2026-06-16 09:16:26 +08:00

36 lines
1.4 KiB
TypeScript

import { describe, expect, it, vi } from 'vitest'
import { openapi } from '../../packages/server/src/controllers/api-docs'
describe('api docs controller', () => {
it('returns the OpenAPI route catalog', async () => {
const ctx = {
set: vi.fn(),
status: 200,
body: undefined as any,
}
await openapi(ctx as any)
expect(ctx.set).toHaveBeenCalledWith('Cache-Control', 'no-store')
expect(ctx.body.openapi).toBe('3.0.3')
expect(ctx.body.paths['/api/openapi.json']).toBeTruthy()
expect(ctx.body.paths['/api/auth/login'].post.requestBody.content['application/json'].schema.required).toEqual([
'password',
'username',
])
expect(ctx.body.paths['/api/auth/users/{id}'].put.parameters).toEqual([
expect.objectContaining({ name: 'id', in: 'path', required: true }),
])
expect(ctx.body.paths['/api/hermes/kanban/search-sessions'].get.parameters).toEqual(
expect.arrayContaining([
expect.objectContaining({ name: 'task_id', in: 'query', required: true }),
expect.objectContaining({ name: 'profile', in: 'query', required: true }),
expect.objectContaining({ name: 'q', in: 'query', required: false }),
]),
)
expect(
ctx.body.paths['/api/chat-run/runs'].post.requestBody.content['application/json'].schema.properties.source.enum,
).toEqual(['cli', 'coding_agent', 'global_agent'])
})
})