Skip to content

Commit 8558e8f

Browse files
committed
fixes, grant more privileges in dev mode
1 parent a3a16ab commit 8558e8f

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

lib/server/WebUiServer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ const { OpenIdConfig, JwtConfig } = require('../config');
1515
const { HttpServer } = require('@aliceo2/web-ui');
1616
const path = require('path');
1717
const buildEndpoints = require('./routers');
18-
const { isInTestMode } = require('../utilities/env-utils');
18+
const { isInTestMode, isInDevMode } = require('../utilities/env-utils');
1919
const { createOrUpdateUser } = require('./services/user/createOrUpdateUser.js');
2020
const { LogManager } = require('@aliceo2/web-ui');
21+
const { BkpRoles } = require('../domain/enums/BkpRoles.js');
2122

2223
/**
2324
* WebUI implementation of the Server.
@@ -74,6 +75,10 @@ class WebUiServer {
7475
if (isInTestMode() && request.query?.token) {
7576
user.access = user.access ?? request.query.token.split(',');
7677
}
78+
79+
if (isInDevMode()) {
80+
user.access = Object.values(BkpRoles);
81+
}
7782
request.session = user;
7883
next();
7984
});

test/public/defaults.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ const waitForTableToLength = async (page, expectedSize) => {
156156
);
157157
} catch {
158158
const actualSize = (await page.$$('tbody tr')).length;
159-
throw new Error(`Expected table of length ${expectedSize}, but got ${actualSize}`);
159+
const isThereLoadingRow = !!(await page.$$('table body tr.loading-row'))
160+
throw new Error(`Expected table of length ${expectedSize}, but got ${actualSize} ${isThereLoadingRow ? ', loading-row' : ''}`);
160161
}
161162
};
162163

test/public/runs/runsPerDataPass.overview.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,12 @@ module.exports = () => {
487487
});
488488

489489
it('should successfully freeze a given data pass', async () => {
490+
await navigateToRunsPerDataPass(page, 2, 1, 3);
490491
await pressElement(page, '#actions-dropdown-button .popover-trigger', true);
491492
const popoverSelector = await getPopoverSelector(await page.waitForSelector('#actions-dropdown-button .popover-trigger'));
492493

493494
await expectInnerText(page, `${popoverSelector} button:nth-child(3)`, 'Freeze the data pass');
494-
await pressElement(page, `${popoverSelector} button:nth-child(3)`);
495+
await pressElement(page, `${popoverSelector} button:nth-child(3)`, true);
495496
});
496497

497498
it('should successfully disable QC flag creation when data pass is frozen', async () => {

0 commit comments

Comments
 (0)