diff --git a/packages/e2e-tests/src/plugins/disable-gravatar.php b/packages/e2e-tests/src/plugins/disable-gravatar.php index 46a9499aa59a..53411a62361a 100644 --- a/packages/e2e-tests/src/plugins/disable-gravatar.php +++ b/packages/e2e-tests/src/plugins/disable-gravatar.php @@ -30,13 +30,22 @@ namespace Google\Web_Stories\E2E\BlockDirectory; +// Hat tip https://github.com/norcross/airplane-mode + add_filter( 'get_avatar', static function ( $avatar, $id_or_email, $size, $default, $alt ) { - // Hat tip https://github.com/norcross/airplane-mode $image = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; return "{$alt}"; }, 1, 5 ); + +add_filter( + 'get_avatar_url', + static function () { + return 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; + }, + 1 +); diff --git a/patches/expect-puppeteer+9.0.0.patch b/patches/expect-puppeteer+9.0.0.patch index 02e9f5fa50cf..c4a6f5aa3542 100644 --- a/patches/expect-puppeteer+9.0.0.patch +++ b/patches/expect-puppeteer+9.0.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/expect-puppeteer/dist/index.js b/node_modules/expect-puppeteer/dist/index.js -index 9db58ab..e1718b8 100644 +index 9db58ab..dd27744 100644 --- a/node_modules/expect-puppeteer/dist/index.js +++ b/node_modules/expect-puppeteer/dist/index.js @@ -4,13 +4,13 @@ const checkIsPuppeteerInstance = (instance)=>{ @@ -10,7 +10,8 @@ index 9db58ab..e1718b8 100644 + return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPPage" || instance?.constructor?.name === "CdpPage"); }; const checkIsFrame = (instance)=>{ - return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "Frame"; +- return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "Frame"; ++ return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPFrame" || instance?.constructor?.name === "CdpFrame"); }; const checkIsElementHandle = (instance)=>{ - return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "CDPElementHandle"; @@ -18,11 +19,3 @@ index 9db58ab..e1718b8 100644 }; const getContext = async (instance, pageFunction)=>{ if (checkIsFrame(instance) || checkIsPage(instance)) { -@@ -485,6 +485,7 @@ const expectPuppeteerInstance = (actual)=>{ - if (checkIsElementHandle(actual)) { - return createExpect(actual, elementHandleMatchers); - } -+ console.log(actual, actual?.constructor?.name); - throw new Error(`${actual} is not supported`); - }; - const expectPuppeteer = (actual)=>{