fix #52: correct the StackedRouter on 'replace'
All checks were successful
/ depoly (push) Successful in 1m26s

This commit is contained in:
thislight 2024-12-21 20:19:02 +08:00
parent ee67993796
commit ee31c38f32
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
5 changed files with 61 additions and 25 deletions

View file

@ -9,11 +9,10 @@ export class SignInPage extends Page {
return $("[name=serverUrl]");
}
public static async beTheCurrentPage() {
public static async urlIsTheCurrent() {
const urlMatched =
new URL(await browser.getUrl()).pathname === "/accounts/sign-in";
const elementShowed = await this.serverUrlInput.isDisplayed();
return urlMatched && elementShowed;
return urlMatched;
}
/**

View file

@ -6,6 +6,8 @@ describe("The index page", () => {
it("jumps to the sign-in page if no account signed in", async () => {
await IndexPage.open("");
expect(await browser.waitUntil(SignInPage.beTheCurrentPage));
expect(await browser.waitUntil(SignInPage.urlIsTheCurrent));
expect(await browser.waitUntil(SignInPage.serverUrlInput.isDisplayed));
});
});