@wordpress/e2e-tests 7.6.5 → 7.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "7.6.5",
3
+ "version": "7.6.6",
4
4
  "description": "End-To-End (E2E) tests for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "3eeb607ebb76c3bf06cb8acb462f0dc068f340f9"
48
+ "gitHead": "86ecd96b3bcada6b4cc35bb2455b3029cebb0ff3"
49
49
  }
@@ -0,0 +1,3 @@
1
+ window.addEventListener( 'load', () => {
2
+ document.body.dataset.iframedEnqueueBlockAssetsL10n = window.iframedEnqueueBlockAssetsL10n.test;
3
+ } );
@@ -17,5 +17,18 @@ add_action(
17
17
  filemtime( plugin_dir_path( __FILE__ ) . 'iframed-enqueue-block-assets/style.css' )
18
18
  );
19
19
  wp_add_inline_style( 'iframed-enqueue-block-assets', 'body{padding:20px!important}' );
20
+ wp_enqueue_script(
21
+ 'iframed-enqueue-block-assets-script',
22
+ plugin_dir_url( __FILE__ ) . 'iframed-enqueue-block-assets/script.js',
23
+ array(),
24
+ filemtime( plugin_dir_path( __FILE__ ) . 'iframed-enqueue-block-assets/script.js' )
25
+ );
26
+ wp_localize_script(
27
+ 'iframed-enqueue-block-assets-script',
28
+ 'iframedEnqueueBlockAssetsL10n',
29
+ array(
30
+ 'test' => 'Iframed Enqueue Block Assets!',
31
+ )
32
+ );
20
33
  }
21
34
  );
@@ -32,6 +32,7 @@ describe( 'iframed inline styles', () => {
32
32
  } );
33
33
 
34
34
  it( 'should load styles added through enqueue_block_assets', async () => {
35
+ await page.waitForSelector( 'iframe[name="editor-canvas"]' );
35
36
  // Check stylesheet.
36
37
  expect(
37
38
  await getComputedStyle( canvas(), 'body', 'background-color' )
@@ -40,5 +41,11 @@ describe( 'iframed inline styles', () => {
40
41
  expect( await getComputedStyle( canvas(), 'body', 'padding' ) ).toBe(
41
42
  '20px'
42
43
  );
44
+
45
+ expect(
46
+ await canvas().evaluate( () => ( { ...document.body.dataset } ) )
47
+ ).toEqual( {
48
+ iframedEnqueueBlockAssetsL10n: 'Iframed Enqueue Block Assets!',
49
+ } );
43
50
  } );
44
51
  } );