mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 15:02:32 +00:00
Add tree navigation tests and shared test utilities
- Add test/utilities.ts with shared helpers (API_KEY, userMsg, assistantMsg, createTestSession) - Add agent-session-tree-navigation.test.ts with e2e tests for tree navigation - Add getChildren() method to SessionManager - Add summaryEntry to navigateTree return type - Update existing tests to use shared utilities
This commit is contained in:
parent
01dae9ebcc
commit
31c5cd38d1
7 changed files with 494 additions and 30 deletions
|
|
@ -696,6 +696,19 @@ export class SessionManager {
|
|||
return this.byId.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all direct children of an entry.
|
||||
*/
|
||||
getChildren(parentId: string): SessionEntry[] {
|
||||
const children: SessionEntry[] = [];
|
||||
for (const entry of this.byId.values()) {
|
||||
if (entry.parentId === parentId) {
|
||||
children.push(entry);
|
||||
}
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the label for an entry, if any.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue