@@ -162,12 +162,23 @@ public function test_init_frontend_client() {
162
162
163
163
// Check that init_client() was called.
164
164
$ this ->assertEquals ( 102 , has_action ( 'admin_bar_menu ' , [ $ this ->instance , 'add_admin_bar_menu_item ' ] ) );
165
+
166
+ // Check if all required scripts has been enqueued.
165
167
$ this ->assertTrue ( wp_script_is ( 'amp-paired-browsing-client ' ) );
168
+ $ this ->assertTrue ( wp_script_is ( 'wp-dom-ready ' ) );
169
+ $ this ->assertTrue ( wp_script_is ( 'wp-polyfill ' ) );
170
+ $ this ->assertTrue ( wp_script_is ( 'wp-polyfill-inert ' ) );
171
+ $ this ->assertTrue ( wp_script_is ( 'regenerator-runtime ' ) );
172
+
166
173
$ printed_scripts = get_echo ( 'wp_print_scripts ' );
167
174
$ this ->assertStringContainsString ( DevMode::DEV_MODE_ATTRIBUTE , $ printed_scripts );
168
175
$ this ->assertStringContainsString ( 'ampPairedBrowsingClientData ' , $ printed_scripts );
169
176
$ this ->assertStringContainsString ( 'isAmpDocument ' , $ printed_scripts );
170
177
$ this ->assertStringContainsString ( 'amp-paired-browsing-client.js ' , $ printed_scripts );
178
+ $ this ->assertStringContainsString ( 'dom-ready.js ' , $ printed_scripts );
179
+ $ this ->assertStringContainsString ( 'wp-polyfill.js ' , $ printed_scripts );
180
+ $ this ->assertStringContainsString ( 'wp-polyfill-inert.js ' , $ printed_scripts );
181
+ $ this ->assertStringContainsString ( 'regenerator-runtime.js ' , $ printed_scripts );
171
182
172
183
// Check that init_app() was not called.
173
184
$ this ->assertFalse ( has_action ( 'template_redirect ' , [ $ this ->instance , 'ensure_app_location ' ] ) );
0 commit comments