puppeteer_test: Add wait call for linkifier table to get updated.

This commit solves a rare flake, where the `realm
_linkifier.ts` test was failing because there was no
appropriate wait call for the table
(`#admin_linkifiers_table`) to get updated after editing
the pattern.
This commit is contained in:
Riken Shah 2021-05-18 13:23:52 +00:00 committed by Tim Abbott
parent 2015d55a17
commit e4bbfe5eb7

View File

@ -64,11 +64,9 @@ async function test_edit_linkifier(page: Page): Promise<void> {
await page.click(".submit-linkifier-info-change");
await page.waitForSelector("#linkifier-edit-form-modal", {hidden: true});
await page.waitForFunction(() => $(".edit-linkifier-status").text().trim() === "Saved");
await page.waitForSelector(".linkifier_row", {visible: true});
assert.strictEqual(
await common.get_text_from_selector(page, ".linkifier_row span.linkifier_pattern"),
"(?P<num>[0-9a-f]{40})",
await page.waitForFunction(
() => document.querySelector(".linkifier_pattern")?.textContent === "(?P<num>[0-9a-f]{40})",
);
assert.strictEqual(
await common.get_text_from_selector(