Skip to content

refactor: Display member role when user has no role #1965

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

Merged
merged 4 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
BrunoQuaresma committed Jun 2, 2022
commit 8c116dfeeb9ac91ef70276370d2d7dd2fee63769
2 changes: 1 addition & 1 deletion site/src/pages/UsersPage/UsersPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe("Users Page", () => {
}, MockAuditorRole)

// Check if the select text was updated with the Auditor role
await waitFor(() => expect(rolesMenuTrigger).toHaveTextContent("Admin, Member, Auditor"))
await waitFor(() => expect(rolesMenuTrigger).toHaveTextContent("Admin, Auditor"))

// Check if the API was called correctly
const currentRoles = MockUser.roles.map((r) => r.name)
Expand Down
6 changes: 3 additions & 3 deletions site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const MockAuditorRole: TypesGen.Role = {
display_name: "Auditor",
}

export const MockSiteRoles = [MockAdminRole, MockAuditorRole, MockMemberRole]
export const MockSiteRoles = [MockAdminRole, MockAuditorRole]

export const MockUser: TypesGen.User = {
id: "test-user",
Expand All @@ -38,7 +38,7 @@ export const MockUser: TypesGen.User = {
created_at: "",
status: "active",
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
roles: [MockAdminRole, MockMemberRole],
roles: [MockAdminRole],
}

export const MockUser2: TypesGen.User = {
Expand All @@ -48,7 +48,7 @@ export const MockUser2: TypesGen.User = {
created_at: "",
status: "active",
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
roles: [MockMemberRole],
roles: [],
}

export const MockOrganization: TypesGen.Organization = {
Expand Down