Files
aryx/tests/shared/workspace.test.ts
T
David KayaandCopilot b302ea5979 feat(workflows): replace basic templates with 8 rich hand-crafted templates
Replace auto-generated pattern-based templates with complex, real-world
workflow templates showcasing all node types and edge features:

- Code Review Pipeline: sequential chain with checkpointing
- Research & Summarize: 3 parallel agents via fan-out/fan-in
- Customer Support Triage: conditional routing with expression edges
- Content Creation Pipeline: writer/editor revision loop
- Multi-Agent Debate: proposer/critic debate loop
- Data Processing with Validation: invoke-function nodes, state scopes
- Approval Workflow: request-port for human-in-the-loop review
- Nested Workflow Orchestrator: inline sub-workflow composition

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 22:27:35 +02:00

60 lines
2.0 KiB
TypeScript

import { describe, expect, test } from 'bun:test';
import { createWorkspaceSeed } from '@shared/domain/workspace';
describe('workspace seed', () => {
test('starts empty and seeds built-in patterns and workflow templates with a shared timestamp', () => {
const workspace = createWorkspaceSeed();
expect(workspace.projects).toEqual([]);
expect(workspace.sessions).toEqual([]);
expect(workspace.settings).toEqual({
theme: 'dark',
tooling: {
mcpServers: [],
lspProfiles: [],
},
discoveredUserTooling: {
mcpServers: [],
},
});
expect(workspace.selectedProjectId).toBeUndefined();
expect(workspace.selectedPatternId).toBeUndefined();
expect(workspace.selectedSessionId).toBeUndefined();
expect(workspace.patterns.map((pattern) => pattern.mode)).toEqual([
'single',
'sequential',
'concurrent',
'handoff',
'group-chat',
'magentic',
]);
expect(workspace.workflowTemplates.map((template) => template.id)).toEqual([
'workflow-template-code-review',
'workflow-template-research-summarize',
'workflow-template-customer-support',
'workflow-template-content-creation',
'workflow-template-multi-agent-debate',
'workflow-template-data-processing',
'workflow-template-approval',
'workflow-template-nested-orchestrator',
]);
for (const pattern of workspace.patterns) {
expect(pattern.createdAt).toBe(workspace.lastUpdatedAt);
expect(pattern.updatedAt).toBe(workspace.lastUpdatedAt);
expect(pattern.approvalPolicy?.rules).toContainEqual({ kind: 'tool-call' });
}
const magentic = workspace.patterns.find((pattern) => pattern.mode === 'magentic');
expect(magentic?.availability).toBe('unavailable');
expect(magentic?.unavailabilityReason).toContain('unsupported');
for (const template of workspace.workflowTemplates) {
expect(template.createdAt).toBe(workspace.lastUpdatedAt);
expect(template.updatedAt).toBe(workspace.lastUpdatedAt);
}
});
});