🐛(frontend) improve e2e tests avoiding race condition from mocks
Reorder mock setup with page.route so that it takes place before nav.
This commit is contained in:
committed by
Laurent Bossavit
parent
8a2b0d0a76
commit
e7af1fd591
@@ -60,12 +60,6 @@ test.describe('Config', () => {
|
||||
page,
|
||||
browserName,
|
||||
}) => {
|
||||
await page.goto('/');
|
||||
// Login with a user who has the visibility on the groups should see groups
|
||||
// It's now the backend that decides if the user can see the group menu and they
|
||||
// should be redirected to the groups page in such case
|
||||
await keyCloakSignIn(page, browserName, 'team-administrator');
|
||||
|
||||
await page.route('**/api/v1.0/config/', async (route) => {
|
||||
const request = route.request();
|
||||
if (request.method().includes('GET')) {
|
||||
@@ -83,6 +77,12 @@ test.describe('Config', () => {
|
||||
}
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
// Login with a user who has the visibility on the groups should see groups
|
||||
// It's now the backend that decides if the user can see the group menu and they
|
||||
// should be redirected to the groups page in such case
|
||||
await keyCloakSignIn(page, browserName, 'team-administrator');
|
||||
|
||||
await expect(page.locator('menu')).toBeHidden();
|
||||
|
||||
await expect(page.getByText('Groups')).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user