puppeteer_test: Use edit linkifier modal's id to check if it's closed.

This commit is contained in:
Riken Shah 2021-05-18 18:38:27 +00:00 committed by Tim Abbott
parent 5ad50b19cb
commit 2015d55a17

View File

@ -56,7 +56,7 @@ async function test_add_invalid_linkifier_pattern(page: Page): Promise<void> {
async function test_edit_linkifier(page: Page): Promise<void> {
await page.click(".linkifier_row .edit");
await page.waitForFunction(() => document.activeElement === $("#linkifier-edit-form-modal")[0]);
await page.waitForFunction(() => document.activeElement?.id === "linkifier-edit-form-modal");
await common.fill_form(page, "form.linkifier-edit-form", {
pattern: "(?P<num>[0-9a-f]{40})",
url_format_string: "https://trac.example.com/commit/%(num)s",
@ -81,7 +81,7 @@ async function test_edit_linkifier(page: Page): Promise<void> {
async function test_edit_invalid_linkifier(page: Page): Promise<void> {
await page.click(".linkifier_row .edit");
await page.waitForFunction(() => document.activeElement === $("#linkifier-edit-form-modal")[0]);
await page.waitForFunction(() => document.activeElement?.id === "linkifier-edit-form-modal");
await common.fill_form(page, "form.linkifier-edit-form", {
pattern: "####",
url_format_string: "####",