feat(FN-987): wire AgentStore to TaskExecutor in dashboard command

- Wire AgentStore into TaskExecutor initialization within dashboard.ts startup
- Add AgentStore mock to dashboard command tests for proper test coverage
- Update test mocks to reflect new AgentStore dependency injection
This commit is contained in:
gsxdsm
2026-04-05 15:55:05 -07:00
parent 18c8fd9858
commit 11dfcaf7e2
3 changed files with 29 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ function makeMockStore() {
openrouterModelSync: true,
}),
listTasks: vi.fn().mockResolvedValue([]),
getFusionDir: vi.fn().mockReturnValue("/tmp/test/.fusion"),
on: vi.fn((event: string, handler: (...args: unknown[]) => void) => {
emitter.on(event, handler);
}),
@@ -38,6 +39,14 @@ vi.mock("@fusion/core", () => ({
listSchedules: vi.fn().mockResolvedValue([]),
getDueSchedules: vi.fn().mockResolvedValue([]),
})),
AgentStore: vi.fn().mockImplementation(() => ({
init: vi.fn().mockResolvedValue(undefined),
createAgent: vi.fn(),
updateAgentState: vi.fn(),
listAgents: vi.fn().mockResolvedValue([]),
getAgent: vi.fn().mockResolvedValue(null),
deleteAgent: vi.fn(),
})),
}));
// ── Mock @fusion/dashboard ─────────────────────────────────────────────