Skip to content

Build your personal knowledge base with Trilium Notes

test(task-states): assert openCustomTaskStateConfig uses the tree popup

Elian Doran70cd858d7a47
diff --git a/apps/client/src/services/task_states.spec.ts b/apps/client/src/services/task_states.spec.ts
index be8671b452..52ca5dede5 100644
--- a/apps/client/src/services/task_states.spec.ts
+++ b/apps/client/src/services/task_states.spec.ts
@@ -135,18 +135,15 @@ describe("getTaskStateDefinitions", () => {
});
describe("openCustomTaskStateConfig", () => {
- it("opens the task-states container hoisted in a new tab", () => {
- const openInNewTab = vi.fn();
- (appContext as unknown as { tabManager: { openInNewTab: typeof openInNewTab } }).tabManager = {
- openInNewTab
- };
+ it("opens the task-states container hoisted in the tree popup", () => {
+ const triggerCommand = vi.fn();
+ (appContext as unknown as { triggerCommand: typeof triggerCommand }).triggerCommand = triggerCommand;
openCustomTaskStateConfig();
- expect(openInNewTab).toHaveBeenCalledWith(
- TASK_STATES_CONTAINER_ID,
- TASK_STATES_CONTAINER_ID,
- true
- );
+ expect(triggerCommand).toHaveBeenCalledWith("openInTreePopup", {
+ noteIdOrPath: TASK_STATES_CONTAINER_ID,
+ hoistedNoteId: TASK_STATES_CONTAINER_ID
+ });
});
});