mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 21:14:35 -07:00
feat(tracker): polish UI sorting and formatting (#22437)
This commit is contained in:
@@ -186,20 +186,55 @@ describe('Tracker Tools Integration', () => {
|
||||
|
||||
expect(display.todos).toEqual([
|
||||
{
|
||||
description: `[p1] [TASK] Parent`,
|
||||
description: `task: Parent (p1)`,
|
||||
status: 'in_progress',
|
||||
},
|
||||
{
|
||||
description: ` [c1] [EPIC] Child`,
|
||||
description: ` epic: Child (c1)`,
|
||||
status: 'pending',
|
||||
},
|
||||
{
|
||||
description: ` [leaf] [BUG] Closed Leaf`,
|
||||
description: ` bug: Closed Leaf (leaf)`,
|
||||
status: 'completed',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('sorts tasks by status', async () => {
|
||||
const t1 = {
|
||||
id: 't1',
|
||||
title: 'T1',
|
||||
type: TaskType.TASK,
|
||||
status: TaskStatus.CLOSED,
|
||||
dependencies: [],
|
||||
};
|
||||
const t2 = {
|
||||
id: 't2',
|
||||
title: 'T2',
|
||||
type: TaskType.TASK,
|
||||
status: TaskStatus.OPEN,
|
||||
dependencies: [],
|
||||
};
|
||||
const t3 = {
|
||||
id: 't3',
|
||||
title: 'T3',
|
||||
type: TaskType.TASK,
|
||||
status: TaskStatus.IN_PROGRESS,
|
||||
dependencies: [],
|
||||
};
|
||||
|
||||
const mockService = {
|
||||
listTasks: async () => [t1, t2, t3],
|
||||
} as unknown as TrackerService;
|
||||
const display = await buildTodosReturnDisplay(mockService);
|
||||
|
||||
expect(display.todos).toEqual([
|
||||
{ description: `task: T3 (t3)`, status: 'in_progress' },
|
||||
{ description: `task: T2 (t2)`, status: 'pending' },
|
||||
{ description: `task: T1 (t1)`, status: 'completed' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('detects cycles', async () => {
|
||||
// Since TrackerTask only has a single parentId, a true cycle is unreachable from roots.
|
||||
// We simulate a database corruption (two tasks with same ID, one root, one child)
|
||||
@@ -220,7 +255,7 @@ describe('Tracker Tools Integration', () => {
|
||||
|
||||
expect(display.todos).toEqual([
|
||||
{
|
||||
description: `[p1] [TASK] Parent`,
|
||||
description: `task: Parent (p1)`,
|
||||
status: 'pending',
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user