Skip to content

Commit

Permalink
Merge pull request #7596 from ampproject/add/wp-inert-polyfill-in-amp…
Browse files Browse the repository at this point in the history
…-devmode

Update paired browsing script dependencies array
  • Loading branch information
westonruter authored Aug 3, 2023
2 parents cebab46 + 533d73d commit d421f58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Admin/PairedBrowsing.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function init_client() {
// Mark enqueued script for AMP dev mode so that it is not removed.
// @todo Revisit with <https://github.com/google/site-kit-wp/pull/505#discussion_r348683617>.
$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(
Expand Down
2 changes: 2 additions & 0 deletions tests/php/src/Admin/PairedBrowsingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit d421f58

Please sign in to comment.