Skip to content

refactor: Update users page to looks like others #1850

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
May 27, 2022
Merged
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
Update new to create
  • Loading branch information
BrunoQuaresma committed May 27, 2022
commit 339c16e1828a00a46a80a5cc683c1abdd97b97bd
12 changes: 6 additions & 6 deletions site/src/pages/UsersPage/UsersPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ describe("Users Page", () => {
expect(users.length).toEqual(2)
})

it("shows 'New user' button to an authorized user", () => {
it("shows 'Create user' button to an authorized user", () => {
render(<UsersPage />)
const newUserButton = screen.queryByText(UsersViewLanguage.newUserButton)
expect(newUserButton).toBeDefined()
const createUserButton = screen.queryByText(UsersViewLanguage.createButton)
expect(createUserButton).toBeDefined()
})

it("does not show 'New user' button to unauthorized user", () => {
it("does not show 'Create user' button to unauthorized user", () => {
server.use(
rest.post("/api/v2/users/:userId/authorization", async (req, res, ctx) => {
const permissions = Object.keys(permissionsToCheck)
Expand All @@ -125,8 +125,8 @@ describe("Users Page", () => {
}),
)
render(<UsersPage />)
const newUserButton = screen.queryByText(UsersViewLanguage.newUserButton)
expect(newUserButton).toBeNull()
const createUserButton = screen.queryByText(UsersViewLanguage.createButton)
expect(createUserButton).toBeNull()
})

describe("suspend user", () => {
Expand Down