Skip to content

Commit b69ac61

Browse files
committed
Use real auth for admin-token UI test
1 parent 943ca28 commit b69ac61

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/UI/specs/UIIntegration_spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,13 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik?
579579
this.title = parentSuite.title; // to make sure the screenshot prefix is the same
580580

581581
it('should not be possible to render any action using token_auth with at least some admin access', async function () {
582+
// Use real auth so the URL token is actually resolved to its user.
583+
// FakeAccess ignores the token and would leave the request as a non-superuser
584+
// after this branch's setSuperUserAccess(false) reset in forceReloadAuthUsingTokenAuth(),
585+
// bypassing the checkTokenAuthIsNotLimited() throw the test is asserting.
586+
testEnvironment.testUseMockAuth = 0;
587+
testEnvironment.save();
588+
582589
await page.goto("?" + generalParams + "&module=CoreAdminHome&action=home&token_auth=c4ca4238a0b923820dcc509a6f75849b");
583590

584591
expect(await page.screenshot({ fullPage: true })).to.matchImage('admin_home_admintoken_not_allowed');

0 commit comments

Comments
 (0)