chore(workspaces): test guest role projects resolver

This commit is contained in:
Alessandro Magionami
2024-08-27 09:46:08 +02:00
parent de956a4e92
commit e85915bd3c
@@ -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)
})
})
})