@wordpress/e2e-tests 3.0.3 → 3.0.7

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": "3.0.3",
3
+ "version": "3.0.7",
4
4
  "description": "End-To-End (E2E) tests for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -26,7 +26,7 @@
26
26
  "@wordpress/e2e-test-utils": "^6.0.1",
27
27
  "@wordpress/jest-console": "^5.0.1",
28
28
  "@wordpress/jest-puppeteer-axe": "^4.0.1",
29
- "@wordpress/scripts": "^21.0.0",
29
+ "@wordpress/scripts": "^22.0.0",
30
30
  "@wordpress/url": "^3.4.1",
31
31
  "chalk": "^4.0.0",
32
32
  "expect-puppeteer": "^4.4.0",
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
47
+ "gitHead": "f73c50580cc209814ec1a2ab8c85b69bd4220d3f"
48
48
  }
@@ -10,12 +10,21 @@ import {
10
10
  createJSONResponse,
11
11
  } from '@wordpress/e2e-test-utils';
12
12
 
13
+ const BLOCK1_NAME = 'block-directory-test-block/main-block';
14
+
13
15
  // Urls to mock
14
16
  const SEARCH_URLS = [
15
17
  '/wp/v2/block-directory/search',
16
18
  `rest_route=${ encodeURIComponent( '/wp/v2/block-directory/search' ) }`,
17
19
  ];
18
20
 
21
+ const BLOCK_TYPE_URLS = [
22
+ `/wp/v2/block-types/${ BLOCK1_NAME }`,
23
+ `rest_route=${ encodeURIComponent(
24
+ `/wp/v2/block-types/${ BLOCK1_NAME }`
25
+ ) }`,
26
+ ];
27
+
19
28
  const INSTALL_URLS = [
20
29
  '/wp/v2/plugins',
21
30
  `rest_route=${ encodeURIComponent( '/wp/v2/plugins' ) }`,
@@ -23,7 +32,7 @@ const INSTALL_URLS = [
23
32
 
24
33
  // Example Blocks
25
34
  const MOCK_BLOCK1 = {
26
- name: 'block-directory-test-block/main-block',
35
+ name: BLOCK1_NAME,
27
36
  title: 'Block Directory Test Block',
28
37
  description: 'This plugin is useful for the block.',
29
38
  id: 'block-directory-test-block',
@@ -109,6 +118,11 @@ const MOCK_BLOCKS_RESPONSES = [
109
118
  request.method() === 'GET',
110
119
  onRequestMatch: createJSONResponse( [ MOCK_BLOCK1, MOCK_BLOCK2 ] ),
111
120
  },
121
+ {
122
+ // Mock response for block type
123
+ match: ( request ) => matchUrl( request.url(), BLOCK_TYPE_URLS ),
124
+ onRequestMatch: createJSONResponse( {} ),
125
+ },
112
126
  {
113
127
  // Mock response for install
114
128
  match: ( request ) => matchUrl( request.url(), INSTALL_URLS ),