Files
waggle-os/packages/server/tests/fleet-ancestry.test.ts
Oleg Maslov 0c3e2ead3b
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled
moving
2026-09-02 10:10:29 +02:00

22 lines
844 B
TypeScript

/**
* AI-OS #6 fast-follow — agent-run goal-ancestry: a spawn carries the agent's
* durable goal + workspace as the "why". Focused unit on the exported helper.
*/
import { describe, it, expect } from 'vitest';
import { buildSpawnAncestry } from '../src/local/routes/fleet.js';
describe('buildSpawnAncestry (#6 agent-run goal)', () => {
it('includes project (workspace) + goal (agent goal)', () => {
expect(buildSpawnAncestry('Acme Redesign', 'Ship the pane')).toEqual({
project: 'Acme Redesign',
goal: 'Ship the pane',
});
});
it('omits empty levels', () => {
expect(buildSpawnAncestry(undefined, 'Ship the pane')).toEqual({ goal: 'Ship the pane' });
expect(buildSpawnAncestry('Acme', undefined)).toEqual({ project: 'Acme' });
expect(buildSpawnAncestry(undefined, undefined)).toEqual({});
});
});