Skip to content

Commit 44fa39e

Browse files
committed
test(web): focus project filter menu assertions
1 parent c31e1fd commit 44fa39e

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

‎apps/web/src/components/threadActionMenu.logic.test.ts‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,10 @@ describe("buildThreadActionMenuItems", () => {
6363
...baseState,
6464
projectFilter: { label: "Beta Project", isActive: true },
6565
});
66-
const item = items.find((candidate) => candidate.id === "filter-by-project");
67-
expect(item).toMatchObject({ label: "Show all projects" });
68-
expect(items.map((candidate) => candidate.id)).toEqual([
69-
"pin",
70-
"settle",
71-
"snooze",
72-
"rename",
73-
"regenerate-title",
74-
"mark-unread",
75-
"filter-by-project",
76-
"copy",
77-
"project-settings",
78-
"archive",
79-
"delete",
80-
]);
66+
const filterIndex = items.findIndex((candidate) => candidate.id === "filter-by-project");
67+
expect(items[filterIndex]).toMatchObject({ label: "Show all projects", icon: "folder-tree" });
68+
expect(items[filterIndex - 1]?.id).toBe("mark-unread");
69+
expect(items[filterIndex + 1]?.id).toBe("copy");
8170
});
8271

8372
it("includes branch items only for threads with a branch", () => {

‎apps/web/src/components/threadActionMenu.logic.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export interface ThreadActionMenuState {
5656

5757
/**
5858
* Single source for the per-thread action menu: the sidebar row's right-click
59-
* menu and the chat header menu both render exactly this list, so labels,
60-
* ordering, and capability gating cannot drift between the two surfaces.
59+
* menu and the chat header menu share labels, ordering, and capability gating.
60+
* Each surface supplies state for the actions it supports.
6161
*/
6262
export function buildThreadActionMenuItems(
6363
state: ThreadActionMenuState,

0 commit comments

Comments
 (0)