mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-26 06:28:47 +02:00
- add shared workflow template and serialization helpers for YAML, Mermaid, and DOT export - add pattern-to-workflow upgrade and template application flows in AryxAppService - persist built-in and custom workflow templates in workspace state and expose new IPC/preload methods - cover the new backend slice with shared and app-service tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
57 lines
1.9 KiB
TypeScript
57 lines
1.9 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-single',
|
|
'workflow-template-sequential',
|
|
'workflow-template-concurrent',
|
|
'workflow-template-handoff',
|
|
'workflow-template-group-chat',
|
|
]);
|
|
|
|
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);
|
|
}
|
|
});
|
|
});
|