(core) Add check for test login page in homeUtil.ts

Summary:
The old regex for login pages, /gristlogin/, used to handle
test login pages too, matching on a query param set in the
URL. A recent change to make the regex more specific broke this.

This fixes that regression by adding an additional check to
isOnLoginPage for the presence of the test login page.

Test Plan: N/A (fixing test)

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D3300
This commit is contained in:
George Gevoian 2022-03-01 12:43:27 -08:00
parent 8f5ce9d610
commit 10097c5423

View File

@ -253,10 +253,11 @@ export class HomeUtil {
}
/**
* Returns whether we are currently on the Cognito login page.
* Returns whether we are currently on the Cognito or test login page.
*/
public async isOnLoginPage() {
return /^https:\/\/gristlogin/.test(await this.driver.getCurrentUrl());
const url = await this.driver.getCurrentUrl();
return /^https:\/\/gristlogin/.test(url) || await this.isOnTestLoginPage();
}
/**