Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove project IDs from workspace role export data and update tests #448

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions apps/api/src/workspace/service/workspace.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,7 @@ export class WorkspaceService {
description: true,
colorCode: true,
hasAdminAuthority: true,
authorities: true,
projects: {
select: {
id: true
}
}
authorities: true
}
})

Expand Down
7 changes: 7 additions & 0 deletions apps/api/src/workspace/workspace.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
let variableService: VariableService
let workspaceRoleService: WorkspaceRoleService

let user1: User, user2: User, user3: User

Check warning on line 75 in apps/api/src/workspace/workspace.e2e.spec.ts

View workflow job for this annotation

GitHub Actions / Validate API

'user3' is assigned a value but never used
let workspace1: Workspace, workspace2: Workspace
let adminRole: WorkspaceRole, memberRole: WorkspaceRole

Expand Down Expand Up @@ -529,6 +529,13 @@
expect(body.icon).toEqual(workspace1.icon)
expect(body.workspaceRoles).toBeInstanceOf(Array)
expect(body.projects).toBeInstanceOf(Array)

const exampleWorkspaceRole = body.workspaceRoles[0]
expect(exampleWorkspaceRole).toHaveProperty('name')
expect(exampleWorkspaceRole).toHaveProperty('description')
expect(exampleWorkspaceRole).toHaveProperty('hasAdminAuthority')
expect(exampleWorkspaceRole).toHaveProperty('authorities')
expect(exampleWorkspaceRole).toHaveProperty('colorCode')
})
})

Expand Down
Loading