Guard closed isolated workspaces on issues

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-04-04 13:04:34 -05:00
parent 4993b5338c
commit 65818c3447
7 changed files with 372 additions and 85 deletions

View file

@ -120,4 +120,28 @@ describe("CommentThread", () => {
root.unmount();
});
});
it("replaces the composer with a warning when comments are disabled", () => {
const root = createRoot(container);
act(() => {
root.render(
<MemoryRouter>
<CommentThread
comments={[]}
composerDisabledReason="Workspace is closed."
onAdd={async () => {}}
/>
</MemoryRouter>,
);
});
expect(container.textContent).toContain("Workspace is closed.");
expect(container.querySelector('textarea[aria-label="Comment editor"]')).toBeNull();
expect(container.textContent).not.toContain("Comment");
act(() => {
root.unmount();
});
});
});