From e85915bd3cc6a0e9397cc28941ed65c5dfbce4c2 Mon Sep 17 00:00:00 2001 From: Alessandro Magionami Date: Tue, 27 Aug 2024 09:46:08 +0200 Subject: [PATCH] chore(workspaces): test guest role projects resolver --- .../tests/integration/workspaces.graph.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts b/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts index aa37abf93..d018621ab 100644 --- a/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts +++ b/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts @@ -263,17 +263,18 @@ describe('Workspaces GQL CRUD', () => { expect(res.data?.workspace?.projects.items?.length).to.equal(1) expect(res.data?.workspace?.projects.totalCount).to.equal(1) + // Test Guest user await createTestUser(user) - const session2 = await testApolloServer({ + const sessionGuest = await testApolloServer({ authUserId: user.id }) await assignToWorkspace(workspace, user, Roles.Workspace.Guest) - const res2 = await session2.execute(GetWorkspaceWithProjectsDocument, { + const res2 = await sessionGuest.execute(GetWorkspaceWithProjectsDocument, { workspaceId: workspace.id }) expect(res2).to.not.haveGraphQLErrors() - expect(res.data?.workspace?.projects.items?.length).to.equal(0) - // expect(res.data?.workspace?.projects.totalCount).to.equal(0) + expect(res2.data?.workspace?.projects.items?.length).to.equal(0) + expect(res2.data?.workspace?.projects.totalCount).to.equal(0) }) }) })