From 9da142c7122b396bda4446572037bd656c5abf46 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Thu, 3 Aug 2023 01:32:51 +0530 Subject: [PATCH 1/2] Update paired browsing dev mode scripts --- src/Admin/PairedBrowsing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Admin/PairedBrowsing.php b/src/Admin/PairedBrowsing.php index 2b5141fd04d..360e158a182 100644 --- a/src/Admin/PairedBrowsing.php +++ b/src/Admin/PairedBrowsing.php @@ -218,7 +218,7 @@ public function init_client() { // Mark enqueued script for AMP dev mode so that it is not removed. // @todo Revisit with . $dev_mode_handles = array_merge( - [ $handle, 'wp-i18n', 'wp-hooks', 'regenerator-runtime', 'wp-polyfill' ], + [ $handle, 'regenerator-runtime', 'wp-polyfill', 'wp-polyfill-inert' ], $dependencies ); add_filter( From 533d73dc3e257aeebe7b18618307a010342c9f87 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Thu, 3 Aug 2023 02:04:02 +0530 Subject: [PATCH 2/2] Update test cases for paired browsing amp dev mode scripts --- tests/php/src/Admin/PairedBrowsingTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/php/src/Admin/PairedBrowsingTest.php b/tests/php/src/Admin/PairedBrowsingTest.php index 994782cac2a..5d26508e35f 100644 --- a/tests/php/src/Admin/PairedBrowsingTest.php +++ b/tests/php/src/Admin/PairedBrowsingTest.php @@ -163,6 +163,8 @@ public function test_init_frontend_client() { // Check that init_client() was called. $this->assertEquals( 102, has_action( 'admin_bar_menu', [ $this->instance, 'add_admin_bar_menu_item' ] ) ); $this->assertTrue( wp_script_is( 'amp-paired-browsing-client' ) ); + $this->assertTrue( wp_script_is( 'wp-dom-ready' ) ); + $printed_scripts = get_echo( 'wp_print_scripts' ); $this->assertStringContainsString( DevMode::DEV_MODE_ATTRIBUTE, $printed_scripts ); $this->assertStringContainsString( 'ampPairedBrowsingClientData', $printed_scripts );