diff --git a/ui/src/pages/Inbox.test.tsx b/ui/src/pages/Inbox.test.tsx index 5f7d5d74..34883a17 100644 --- a/ui/src/pages/Inbox.test.tsx +++ b/ui/src/pages/Inbox.test.tsx @@ -295,6 +295,38 @@ describe("Inbox toolbar", () => { }); }); + it("hides workspace grouping when isolated workspaces are disabled", async () => { + routerMock.location.pathname = "/inbox/mine"; + apiMocks.experimentalSettings.mockResolvedValue({ enableIsolatedWorkspaces: false }); + + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false, staleTime: 0, gcTime: 0 } }, + }); + const root = createRoot(container); + + await act(async () => { + root.render( + + + , + ); + }); + + const groupButton = container.querySelector('button[title="Group"]'); + expect(groupButton).not.toBeNull(); + + await act(async () => { + groupButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })); + }); + + const groupOptions = Array.from(document.body.querySelectorAll("button")).map((button) => button.textContent); + expect(groupOptions).not.toContain("Workspace"); + + act(() => { + root.unmount(); + }); + }); + it("syncs hover with j/k selection on inbox rows", async () => { routerMock.location.pathname = "/inbox/mine"; const issueA = createIssue({ id: "issue-a", identifier: "PAP-1001", title: "First inbox row" });