Files
nexus/frontend/tests/task-agent-options.test.ts
T
AzuTear f5552218bc
CI - Build & Test / Backend (.NET) (push) Successful in 42s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m46s
CI - Build & Test / Security Check (push) Successful in 3s
CI - Build & Test / Deploy Nexus (push) Successful in 56s
feat: ship agent-first mission control v0.2.57
2026-07-31 22:39:47 +02:00

43 lines
1.4 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
buildTaskAgentOptions,
taskAgentLabel,
} from '../src/utils/taskAgentOptions'
describe('live task assignee options', () => {
it('combines only local assignment concepts with the live OpenClaw inventory', () => {
const options = buildTaskAgentOptions([
{ id: 'iris', name: 'Iris' },
{ id: 'new-specialist', name: 'New Specialist' },
])
expect(options).toEqual([
{ id: '', label: 'Nicht zugewiesen' },
{ id: 'bao', label: 'Bao' },
{ id: 'iris', label: 'Iris' },
{ id: 'new-specialist', label: 'New Specialist' },
])
expect(options.some(option => option.id === 'programmer')).toBe(false)
})
it('preserves a persisted unknown assignee while OpenClaw is disconnected', () => {
const options = buildTaskAgentOptions([], ['retired-agent'])
expect(options).toContainEqual({
id: 'retired-agent',
label: 'retired-agent',
})
expect(taskAgentLabel('retired-agent', options)).toBe('retired-agent')
})
it('prefers the live display name for an already persisted agent id', () => {
const options = buildTaskAgentOptions(
[{ id: 'product-owner', name: 'Product Owner' }],
['product-owner'],
)
expect(taskAgentLabel('product-owner', options)).toBe('Product Owner')
expect(options.filter(option => option.id === 'product-owner')).toHaveLength(1)
})
})