From 775501e7867284fcebf2af24b5e86366bf7b52db Mon Sep 17 00:00:00 2001 From: Daniel Kantor Date: Wed, 12 Feb 2025 12:46:52 +0100 Subject: [PATCH] only show notice on actual default workspace --- .../workspace/components/__tests__/workspace-name.test.tsx | 5 ++++- src/features/workspace/components/workspace-name.tsx | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/features/workspace/components/__tests__/workspace-name.test.tsx b/src/features/workspace/components/__tests__/workspace-name.test.tsx index d83ff4cb..624cdaf8 100644 --- a/src/features/workspace/components/__tests__/workspace-name.test.tsx +++ b/src/features/workspace/components/__tests__/workspace-name.test.tsx @@ -56,12 +56,15 @@ test("can't rename active workspace", async () => { }); test("can't rename archived workspace", async () => { - const { getByRole } = render( + const { getByRole, queryByText } = render( , ); expect(getByRole("textbox", { name: /workspace name/i })).toBeDisabled(); expect(getByRole("button", { name: /save/i })).toBeDisabled(); + expect( + queryByText(/cannot rename the default workspace/i), + ).not.toBeInTheDocument(); }); test("can't rename default workspace", async () => { diff --git a/src/features/workspace/components/workspace-name.tsx b/src/features/workspace/components/workspace-name.tsx index adb8add7..e7f4580a 100644 --- a/src/features/workspace/components/workspace-name.tsx +++ b/src/features/workspace/components/workspace-name.tsx @@ -70,7 +70,9 @@ export function WorkspaceName({