From cb5433e2c40212de362c60a57b122859ad88f712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Wed, 9 Oct 2024 16:36:20 +0100 Subject: [PATCH 1/2] test: Make test fail by setting non-templates team --- .../components/Team/tests/TeamMembers.addNewEditor.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Team/tests/TeamMembers.addNewEditor.test.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Team/tests/TeamMembers.addNewEditor.test.tsx index cbf0765d4f..2707a882df 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Team/tests/TeamMembers.addNewEditor.test.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Team/tests/TeamMembers.addNewEditor.test.tsx @@ -129,7 +129,7 @@ describe("when a user is not a platform admin", () => { useStore.setState({ teamMembers: mockTeamMembersData, user: mockPlainUser, - teamSlug: "templates", + teamSlug: "trumptonshire", }); }); From 354b8302410d954e74ea4a167ed680ed8f953065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Wed, 9 Oct 2024 16:38:15 +0100 Subject: [PATCH 2/2] fix: Make test pass by padding permission guard --- .../Team/components/MembersTable.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Team/components/MembersTable.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Team/components/MembersTable.tsx index 9c65ad4334..989a73eee0 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Team/components/MembersTable.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Team/components/MembersTable.tsx @@ -194,17 +194,19 @@ export const MembersTable = ({ ))} {showAddMemberButton && ( - - - { - addUser(); - }} - > - Add a new editor - - - + + + + { + addUser(); + }} + > + Add a new editor + + + + )}