Consistently use string arguments for page.waitForFunction calls

We use string arguments in all other places, so these two places are a
bit inconsistent in that sense. Moreover, it's just one argument now,
which makes it a bit easier to read and see what it does because we
don't have to pass the always-empty options argument anymore. Finally,
doing it like this ensures it works in all Puppeteer versions given
https://github.com/puppeteer/puppeteer/issues/7836.
This commit is contained in:
Tim van der Meij 2021-12-12 19:40:50 +01:00
parent e638a84afe
commit 1bc6b846b6
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -696,14 +696,9 @@ describe("Interaction", () => {
);
await page.click(`[data-annotation-id='${id}R']`);
const selector = ref.replace("\\", "\\\\");
await page.waitForFunction(
(_ref, _current, _propName) =>
getComputedStyle(document.querySelector(_ref))[_propName] !==
_current,
{},
ref,
current,
propName
`getComputedStyle(document.querySelector("${selector}"))["${propName}"] !== "${current}"`
);
const color = await page.$eval(
@ -755,11 +750,7 @@ describe("Interaction", () => {
await page.keyboard.press("Tab");
await page.waitForFunction(
_prev =>
getComputedStyle(document.querySelector("#\\31 71R")).value !==
_prev,
{},
prev
`getComputedStyle(document.querySelector("#\\\\31 71R")).value !== "${prev}"`
);
sum += val;