Skip to content

Commit ce32312

Browse files
committed
test: update test cases for priority display
1 parent f0fead9 commit ce32312

1 file changed

Lines changed: 48 additions & 48 deletions

File tree

tests/index.test.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,28 @@ describe("TaskMaster.listQuickAsync", () => {
118118
expect(plainResult).not.toContain("Task 2");
119119
});
120120

121-
test("displays priorities correctly", async () => {
122-
const tasks: I_Tasks = {
123-
master: {
124-
tasks: [
125-
createTask(1, "High", "todo", "high"),
126-
createTask(2, "Medium", "todo", "medium"),
127-
createTask(3, "Low", "todo", "low"),
128-
],
129-
metadata: {
130-
created: new Date(),
131-
updated: new Date(),
132-
description: "",
133-
},
134-
},
135-
};
136-
137-
const result = await tmai.listQuickAsync(tasks, "", true);
138-
const plainResult = stripAnsi(result);
139-
expect(plainResult).toContain("[priority: high]");
140-
expect(plainResult).toContain("[priority: medium]");
141-
expect(plainResult).toContain("[priority: low]");
142-
});
121+
test("displays priorities correctly", async () => {
122+
const tasks: I_Tasks = {
123+
master: {
124+
tasks: [
125+
createTask(1, "High", "todo", "high"),
126+
createTask(2, "Medium", "todo", "medium"),
127+
createTask(3, "Low", "todo", "low"),
128+
],
129+
metadata: {
130+
created: new Date(),
131+
updated: new Date(),
132+
description: "",
133+
},
134+
},
135+
};
136+
137+
const result = await tmai.listQuickAsync(tasks, "", true);
138+
const plainResult = stripAnsi(result);
139+
expect(plainResult).toContain("[priority: high]");
140+
expect(plainResult).toContain("[priority: medium]");
141+
expect(plainResult).toContain("[priority: low]");
142+
});
143143

144144
test("displays a message when there are no tasks", async () => {
145145
const tasks: I_Tasks = {
@@ -158,7 +158,7 @@ describe("TaskMaster.listQuickAsync", () => {
158158
expect(plainResult).toContain("No tasks to display.");
159159
});
160160

161-
test("filters by status", async () => {
161+
test("filters by status", async () => {
162162
const tasks: I_Tasks = {
163163
master: {
164164
tasks: [
@@ -181,31 +181,31 @@ describe("TaskMaster.listQuickAsync", () => {
181181
expect(plainResult).not.toContain("Task 2");
182182
});
183183

184-
test("filters subtasks by status correctly", async () => {
185-
const tasks: I_Tasks = {
186-
master: {
187-
tasks: [
188-
createTask(1, "Parent Task", "todo", "medium", [
189-
createSubtask(1, "Subtask 1", "done"),
190-
createSubtask(2, "Subtask 2", "blocked"),
191-
createSubtask(3, "Subtask 3", "in-progress"),
192-
]),
193-
],
194-
metadata: {
195-
created: new Date(),
196-
updated: new Date(),
197-
description: "",
198-
},
199-
},
200-
};
201-
202-
const result = await tmai.listQuickAsync(tasks, "done,blocked", true);
203-
const plainResult = stripAnsi(result);
204-
expect(plainResult).toContain("Parent Task");
205-
expect(plainResult).toContain("Subtask 1");
206-
expect(plainResult).toContain("Subtask 2");
207-
expect(plainResult).not.toContain("Subtask 3");
208-
});
184+
test("filters subtasks by status correctly", async () => {
185+
const tasks: I_Tasks = {
186+
master: {
187+
tasks: [
188+
createTask(1, "Parent Task", "todo", "medium", [
189+
createSubtask(1, "Subtask 1", "done"),
190+
createSubtask(2, "Subtask 2", "blocked"),
191+
createSubtask(3, "Subtask 3", "in-progress"),
192+
]),
193+
],
194+
metadata: {
195+
created: new Date(),
196+
updated: new Date(),
197+
description: "",
198+
},
199+
},
200+
};
201+
202+
const result = await tmai.listQuickAsync(tasks, "done,blocked", true);
203+
const plainResult = stripAnsi(result);
204+
expect(plainResult).toContain("Parent Task");
205+
expect(plainResult).toContain("Subtask 1");
206+
expect(plainResult).toContain("Subtask 2");
207+
expect(plainResult).not.toContain("Subtask 3");
208+
});
209209

210210
test("truncates long titles", async () => {
211211
const longTitle =

0 commit comments

Comments
 (0)