-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* parking user role assign stuff * fix: code style * chore: add tests for user role assignments --------- Co-authored-by: takaro-ci-bot[bot] <138661031+takaro-ci-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a59613c
commit d4fbe89
Showing
17 changed files
with
404 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import playwright from '@playwright/test'; | ||
import { test } from '../fixtures/index.js'; | ||
|
||
const { expect } = playwright; | ||
|
||
test('Can view users', async ({ page, takaro }) => { | ||
await page.getByRole('link', { name: 'Users' }).click(); | ||
await expect(page.getByText(takaro.rootUser.email)).toBeVisible(); | ||
}); | ||
|
||
test.describe('Role assignment', () => { | ||
test('Can assign a role to a user', async ({ page }) => { | ||
await page.getByRole('link', { name: 'Users' }).click(); | ||
|
||
await page.getByRole('button', { name: 'user-actions' }).click(); | ||
await page.getByRole('menuitem', { name: 'Go to user profile' }).click(); | ||
|
||
await page.getByRole('button', { name: 'Assign role' }).click(); | ||
|
||
await page.locator('#roleId').click(); | ||
await page.getByRole('option', { name: 'Player' }).click(); | ||
|
||
await page.getByRole('button', { name: 'Save changes' }).click(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Player', exact: true })).toBeVisible(); | ||
}); | ||
|
||
test('Can remove a role from a user', async ({ page }) => { | ||
await page.getByRole('link', { name: 'Users' }).click(); | ||
|
||
await page.getByRole('button', { name: 'user-actions' }).click(); | ||
await page.getByRole('menuitem', { name: 'Go to user profile' }).click(); | ||
|
||
await page.getByRole('button', { name: 'Assign role' }).click(); | ||
|
||
await page.locator('#roleId').click(); | ||
await page.getByRole('option', { name: 'Player' }).click(); | ||
|
||
await page.getByRole('button', { name: 'Save changes' }).click(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Player', exact: true })).toBeVisible(); | ||
|
||
await page | ||
.getByRole('row', { name: 'Player player-actions' }) | ||
.getByRole('button', { name: 'player-actions' }) | ||
.click(); | ||
await page.getByRole('menuitem', { name: 'Unassign role' }).click(); | ||
|
||
await expect(page.getByRole('cell', { name: 'Player', exact: true })).not.toBeVisible(); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
packages/lib-apiclient/src/generated/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.6.0 | ||
6.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.