@wordpress/e2e-tests 3.0.7 → 3.0.10-next.a55ed9455a.0
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/config/setup-performance-test.js +1 -1
- package/config/setup-test-framework.js +1 -1
- package/package.json +7 -7
- package/specs/editor/blocks/__snapshots__/heading.test.js.snap +8 -8
- package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +16 -16
- package/specs/editor/blocks/__snapshots__/quote.test.js.snap +10 -10
- package/specs/editor/blocks/classic.test.js +2 -2
- package/specs/editor/blocks/cover.test.js +17 -17
- package/specs/editor/blocks/image.test.js +4 -3
- package/specs/editor/blocks/list.test.js +1 -1
- package/specs/editor/blocks/navigation.test.js +392 -65
- package/specs/editor/blocks/table.test.js +1 -1
- package/specs/editor/plugins/align-hook.test.js +10 -10
- package/specs/editor/plugins/block-context.test.js +1 -1
- package/specs/editor/plugins/block-directory-add.test.js +14 -14
- package/specs/editor/plugins/custom-post-types.test.js +1 -1
- package/specs/editor/plugins/custom-taxonomies.test.js +3 -3
- package/specs/editor/plugins/meta-attribute-block.test.js +1 -1
- package/specs/editor/plugins/meta-boxes.test.js +3 -3
- package/specs/editor/plugins/templates.test.js +1 -1
- package/specs/editor/plugins/wp-editor-meta-box.test.js +1 -1
- package/specs/editor/various/__snapshots__/block-grouping.test.js.snap +4 -4
- package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +2 -2
- package/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap +3 -3
- package/specs/editor/various/autosave.test.js +19 -19
- package/specs/editor/various/block-deletion.test.js +5 -5
- package/specs/editor/various/block-grouping.test.js +29 -12
- package/specs/editor/various/block-hierarchy-navigation.test.js +5 -5
- package/specs/editor/various/change-detection.test.js +3 -3
- package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
- package/specs/editor/various/copy-cut-paste-whole-blocks.test.js +7 -7
- package/specs/editor/various/datepicker.test.js +1 -1
- package/specs/editor/various/duplicating-blocks.test.js +3 -3
- package/specs/editor/various/editor-modes.test.js +5 -5
- package/specs/editor/various/inserting-blocks.test.js +6 -6
- package/specs/editor/various/invalid-block.test.js +4 -4
- package/specs/editor/various/is-typing.test.js +8 -8
- package/specs/editor/various/keyboard-navigable-blocks.test.js +2 -2
- package/specs/editor/various/links.test.js +90 -90
- package/specs/editor/various/list-view.test.js +142 -1
- package/specs/editor/various/manage-reusable-blocks.test.js +5 -5
- package/specs/editor/various/multi-block-selection.test.js +86 -2
- package/specs/editor/various/navigable-toolbar.test.js +1 -1
- package/specs/editor/various/new-post-default-content.test.js +2 -2
- package/specs/editor/various/new-post.test.js +1 -1
- package/specs/editor/various/nux.test.js +11 -11
- package/specs/editor/various/popovers.test.js +3 -3
- package/specs/editor/various/post-editor-template-mode.test.js +189 -11
- package/specs/editor/various/post-visibility.test.js +1 -1
- package/specs/editor/various/preferences.test.js +1 -1
- package/specs/editor/various/preview.test.js +8 -4
- package/specs/editor/various/publish-button.test.js +2 -2
- package/specs/editor/various/publishing.test.js +50 -1
- package/specs/editor/various/reusable-blocks.test.js +31 -31
- package/specs/editor/various/rich-text.test.js +1 -1
- package/specs/editor/various/splitting-merging.test.js +6 -6
- package/specs/editor/various/style-variation.test.js +2 -2
- package/specs/editor/various/switch-to-draft.test.js +256 -0
- package/specs/editor/various/taxonomies.test.js +1 -1
- package/specs/editor/various/toolbar-roving-tabindex.test.js +1 -1
- package/specs/editor/various/writing-flow.test.js +85 -20
- package/specs/experiments/navigation-editor.test.js +168 -3
- package/specs/performance/post-editor.test.js +7 -7
- package/specs/performance/site-editor.test.js +6 -7
- package/specs/site-editor/document-settings.test.js +8 -8
- package/specs/site-editor/multi-entity-editing.test.js +6 -6
- package/specs/site-editor/multi-entity-saving.test.js +5 -4
- package/specs/site-editor/settings-sidebar.test.js +5 -5
- package/specs/site-editor/site-editor-export.test.js +3 -3
- package/specs/site-editor/site-editor-inserter.test.js +3 -3
- package/specs/site-editor/template-part.test.js +27 -26
- package/specs/site-editor/template-revert.test.js +12 -22
- package/specs/widgets/customizing-widgets.test.js +14 -9
- package/specs/widgets/editing-widgets.test.js +8 -7
@@ -16,7 +16,7 @@ import {
|
|
16
16
|
*/
|
17
17
|
const PUPPETEER_TIMEOUT = process.env.PUPPETEER_TIMEOUT;
|
18
18
|
|
19
|
-
// The Jest timeout is increased because these tests are a bit slow
|
19
|
+
// The Jest timeout is increased because these tests are a bit slow.
|
20
20
|
jest.setTimeout( PUPPETEER_TIMEOUT || 100000 );
|
21
21
|
|
22
22
|
async function setupBrowser() {
|
@@ -65,7 +65,7 @@ const OBSERVED_CONSOLE_MESSAGE_TYPES = {
|
|
65
65
|
*/
|
66
66
|
const pageEvents = [];
|
67
67
|
|
68
|
-
// The Jest timeout is increased because these tests are a bit slow
|
68
|
+
// The Jest timeout is increased because these tests are a bit slow.
|
69
69
|
jest.setTimeout( PUPPETEER_TIMEOUT || 100000 );
|
70
70
|
|
71
71
|
// Retry failed tests at most 2 times in CI.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.10-next.a55ed9455a.0",
|
4
4
|
"description": "End-To-End (E2E) tests for WordPress.",
|
5
5
|
"author": "The WordPress Contributors",
|
6
6
|
"license": "GPL-2.0-or-later",
|
@@ -23,11 +23,11 @@
|
|
23
23
|
"node": ">=12"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@wordpress/e2e-test-utils": "^
|
27
|
-
"@wordpress/jest-console": "^5.0.
|
28
|
-
"@wordpress/jest-puppeteer-axe": "^4.0.
|
29
|
-
"@wordpress/scripts": "^22.
|
30
|
-
"@wordpress/url": "^3.4.
|
26
|
+
"@wordpress/e2e-test-utils": "^7.0.1-next.a55ed9455a.0",
|
27
|
+
"@wordpress/jest-console": "^5.0.2-next.a55ed9455a.0",
|
28
|
+
"@wordpress/jest-puppeteer-axe": "^4.0.2-next.a55ed9455a.0",
|
29
|
+
"@wordpress/scripts": "^22.1.1-next.a55ed9455a.0",
|
30
|
+
"@wordpress/url": "^3.4.2-next.a55ed9455a.0",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
33
33
|
"filenamify": "^4.2.0",
|
@@ -44,5 +44,5 @@
|
|
44
44
|
"publishConfig": {
|
45
45
|
"access": "public"
|
46
46
|
},
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "c5108185851b824d531bce55991a3589947e8551"
|
48
48
|
}
|
@@ -2,25 +2,25 @@
|
|
2
2
|
|
3
3
|
exports[`Heading can be created by prefixing existing content with number signs and a space 1`] = `
|
4
4
|
"<!-- wp:heading {\\"level\\":4} -->
|
5
|
-
<h4
|
5
|
+
<h4>4</h4>
|
6
6
|
<!-- /wp:heading -->"
|
7
7
|
`;
|
8
8
|
|
9
9
|
exports[`Heading can be created by prefixing number sign and a space 1`] = `
|
10
10
|
"<!-- wp:heading {\\"level\\":3} -->
|
11
|
-
<h3
|
11
|
+
<h3>3</h3>
|
12
12
|
<!-- /wp:heading -->"
|
13
13
|
`;
|
14
14
|
|
15
15
|
exports[`Heading should correctly apply custom colors 1`] = `
|
16
16
|
"<!-- wp:heading {\\"level\\":3,\\"style\\":{\\"color\\":{\\"text\\":\\"#0782f6\\"}}} -->
|
17
|
-
<h3 class=\\"has-text-color\\"
|
17
|
+
<h3 class=\\"has-text-color\\" style=\\"color:#0782f6\\">Heading</h3>
|
18
18
|
<!-- /wp:heading -->"
|
19
19
|
`;
|
20
20
|
|
21
21
|
exports[`Heading should correctly apply named colors 1`] = `
|
22
22
|
"<!-- wp:heading {\\"textColor\\":\\"luminous-vivid-orange\\"} -->
|
23
|
-
<h2 class=\\"has-luminous-vivid-orange-color has-text-color\\"
|
23
|
+
<h2 class=\\"has-luminous-vivid-orange-color has-text-color\\">Heading</h2>
|
24
24
|
<!-- /wp:heading -->"
|
25
25
|
`;
|
26
26
|
|
@@ -30,13 +30,13 @@ exports[`Heading should create a paragraph block above when pressing enter at th
|
|
30
30
|
<!-- /wp:paragraph -->
|
31
31
|
|
32
32
|
<!-- wp:heading -->
|
33
|
-
<h2
|
33
|
+
<h2>a</h2>
|
34
34
|
<!-- /wp:heading -->"
|
35
35
|
`;
|
36
36
|
|
37
37
|
exports[`Heading should create a paragraph block below when pressing enter at the end 1`] = `
|
38
38
|
"<!-- wp:heading -->
|
39
|
-
<h2
|
39
|
+
<h2>a</h2>
|
40
40
|
<!-- /wp:heading -->
|
41
41
|
|
42
42
|
<!-- wp:paragraph -->
|
@@ -46,12 +46,12 @@ exports[`Heading should create a paragraph block below when pressing enter at th
|
|
46
46
|
|
47
47
|
exports[`Heading should not work with the list input rule 1`] = `
|
48
48
|
"<!-- wp:heading -->
|
49
|
-
<h2
|
49
|
+
<h2>1. H</h2>
|
50
50
|
<!-- /wp:heading -->"
|
51
51
|
`;
|
52
52
|
|
53
53
|
exports[`Heading should work with the format input rules 1`] = `
|
54
54
|
"<!-- wp:heading -->
|
55
|
-
<h2
|
55
|
+
<h2><code>code</code></h2>
|
56
56
|
<!-- /wp:heading -->"
|
57
57
|
`;
|
@@ -1,20 +1,6 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
-
exports[`Navigation allows
|
4
|
-
"<!-- wp:navigation-link {\\"label\\":\\"WP\\",\\"url\\":\\"https://wordpress.org\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
|
5
|
-
|
6
|
-
<!-- wp:navigation-link {\\"label\\":\\"Contact\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/get-in-touch\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
|
7
|
-
`;
|
8
|
-
|
9
|
-
exports[`Navigation allows pages to be created from the navigation block and their links added to menu 1`] = `"<!-- wp:navigation-link {\\"label\\":\\"A really long page name that will not exist\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"`;
|
10
|
-
|
11
|
-
exports[`Navigation encodes URL when create block if needed 1`] = `
|
12
|
-
"<!-- wp:navigation-link {\\"label\\":\\"wordpress.org/шеллы\\",\\"url\\":\\"https://wordpress.org/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
|
13
|
-
|
14
|
-
<!-- wp:navigation-link {\\"label\\":\\"お問い合わせ\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
|
15
|
-
`;
|
16
|
-
|
17
|
-
exports[`Navigation placeholder allows a navigation block to be created from existing menus 1`] = `
|
3
|
+
exports[`Navigation Placeholder placeholder actions allows a navigation block to be created from existing menus 1`] = `
|
18
4
|
"<!-- wp:navigation-link {\\"label\\":\\"Home\\",\\"type\\":\\"custom\\",\\"url\\":\\"http://localhost:8889/\\",\\"kind\\":\\"custom\\"} /-->
|
19
5
|
|
20
6
|
<!-- wp:navigation-submenu {\\"label\\":\\"About\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} -->
|
@@ -42,6 +28,20 @@ exports[`Navigation placeholder allows a navigation block to be created from exi
|
|
42
28
|
<!-- /wp:navigation-submenu -->"
|
43
29
|
`;
|
44
30
|
|
45
|
-
exports[`Navigation placeholder creates an empty navigation block when the selected existing menu is also empty 1`] = `""`;
|
31
|
+
exports[`Navigation Placeholder placeholder actions creates an empty navigation block when the selected existing menu is also empty 1`] = `""`;
|
32
|
+
|
33
|
+
exports[`Navigation allows an empty navigation block to be created and manually populated using a mixture of internal and external links 1`] = `
|
34
|
+
"<!-- wp:navigation-link {\\"label\\":\\"WP\\",\\"url\\":\\"https://wordpress.org\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
|
35
|
+
|
36
|
+
<!-- wp:navigation-link {\\"label\\":\\"Contact\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/get-in-touch\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
|
37
|
+
`;
|
38
|
+
|
39
|
+
exports[`Navigation allows pages to be created from the navigation block and their links added to menu 1`] = `"<!-- wp:navigation-link {\\"label\\":\\"A really long page name that will not exist\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"`;
|
40
|
+
|
41
|
+
exports[`Navigation encodes URL when create block if needed 1`] = `
|
42
|
+
"<!-- wp:navigation-link {\\"label\\":\\"wordpress.org/шеллы\\",\\"url\\":\\"https://wordpress.org/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
|
43
|
+
|
44
|
+
<!-- wp:navigation-link {\\"label\\":\\"お問い合わせ\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
|
45
|
+
`;
|
46
46
|
|
47
47
|
exports[`Navigation supports navigation blocks that have inner blocks within their markup and converts them to wp_navigation posts 1`] = `"<!-- wp:page-list /-->"`;
|
@@ -40,7 +40,7 @@ exports[`Quote can be converted to paragraphs and renders only one paragraph for
|
|
40
40
|
|
41
41
|
exports[`Quote can be created by converting a heading 1`] = `
|
42
42
|
"<!-- wp:quote -->
|
43
|
-
<blockquote class=\\"wp-block-quote\\"
|
43
|
+
<blockquote class=\\"wp-block-quote\\"><p>test</p></blockquote>
|
44
44
|
<!-- /wp:quote -->"
|
45
45
|
`;
|
46
46
|
|
@@ -144,7 +144,7 @@ exports[`Quote can be split in the middle and merged back 4`] = `
|
|
144
144
|
|
145
145
|
exports[`Quote is transformed to a heading and a quote if the quote contains a citation 1`] = `
|
146
146
|
"<!-- wp:heading -->
|
147
|
-
<h2
|
147
|
+
<h2>one</h2>
|
148
148
|
<!-- /wp:heading -->
|
149
149
|
|
150
150
|
<!-- wp:quote -->
|
@@ -154,7 +154,7 @@ exports[`Quote is transformed to a heading and a quote if the quote contains a c
|
|
154
154
|
|
155
155
|
exports[`Quote is transformed to a heading and a quote if the quote contains multiple paragraphs 1`] = `
|
156
156
|
"<!-- wp:heading -->
|
157
|
-
<h2
|
157
|
+
<h2>one</h2>
|
158
158
|
<!-- /wp:heading -->
|
159
159
|
|
160
160
|
<!-- wp:quote -->
|
@@ -164,7 +164,7 @@ exports[`Quote is transformed to a heading and a quote if the quote contains mul
|
|
164
164
|
|
165
165
|
exports[`Quote is transformed to a heading if the quote just contains one paragraph 1`] = `
|
166
166
|
"<!-- wp:heading -->
|
167
|
-
<h2
|
167
|
+
<h2>one</h2>
|
168
168
|
<!-- /wp:heading -->"
|
169
169
|
`;
|
170
170
|
|
@@ -176,7 +176,7 @@ exports[`Quote is transformed to an empty heading if the quote is empty 1`] = `
|
|
176
176
|
|
177
177
|
exports[`Quote the resuling quote after transforming to a heading can be transformed again 1`] = `
|
178
178
|
"<!-- wp:heading -->
|
179
|
-
<h2
|
179
|
+
<h2>one</h2>
|
180
180
|
<!-- /wp:heading -->
|
181
181
|
|
182
182
|
<!-- wp:quote -->
|
@@ -186,11 +186,11 @@ exports[`Quote the resuling quote after transforming to a heading can be transfo
|
|
186
186
|
|
187
187
|
exports[`Quote the resuling quote after transforming to a heading can be transformed again 2`] = `
|
188
188
|
"<!-- wp:heading -->
|
189
|
-
<h2
|
189
|
+
<h2>one</h2>
|
190
190
|
<!-- /wp:heading -->
|
191
191
|
|
192
192
|
<!-- wp:heading -->
|
193
|
-
<h2
|
193
|
+
<h2>two</h2>
|
194
194
|
<!-- /wp:heading -->
|
195
195
|
|
196
196
|
<!-- wp:quote -->
|
@@ -200,14 +200,14 @@ exports[`Quote the resuling quote after transforming to a heading can be transfo
|
|
200
200
|
|
201
201
|
exports[`Quote the resuling quote after transforming to a heading can be transformed again 3`] = `
|
202
202
|
"<!-- wp:heading -->
|
203
|
-
<h2
|
203
|
+
<h2>one</h2>
|
204
204
|
<!-- /wp:heading -->
|
205
205
|
|
206
206
|
<!-- wp:heading -->
|
207
|
-
<h2
|
207
|
+
<h2>two</h2>
|
208
208
|
<!-- /wp:heading -->
|
209
209
|
|
210
210
|
<!-- wp:heading -->
|
211
|
-
<h2
|
211
|
+
<h2>cite</h2>
|
212
212
|
<!-- /wp:heading -->"
|
213
213
|
`;
|
@@ -106,7 +106,7 @@ describe( 'Classic', () => {
|
|
106
106
|
} );
|
107
107
|
|
108
108
|
it( 'Should not fail after save/reload', async () => {
|
109
|
-
// Might move to utils if this becomes useful enough for other tests
|
109
|
+
// Might move to utils if this becomes useful enough for other tests.
|
110
110
|
const runWithoutCache = async ( cb ) => {
|
111
111
|
try {
|
112
112
|
await page.setCacheEnabled( false );
|
@@ -128,7 +128,7 @@ describe( 'Classic', () => {
|
|
128
128
|
// Move focus away.
|
129
129
|
await pressKeyWithModifier( 'shift', 'Tab' );
|
130
130
|
|
131
|
-
// Save
|
131
|
+
// Save.
|
132
132
|
await saveDraft();
|
133
133
|
|
134
134
|
// Reload
|
@@ -43,21 +43,21 @@ describe( 'Cover', () => {
|
|
43
43
|
|
44
44
|
it( 'can set overlay color using color picker on block placeholder', async () => {
|
45
45
|
await insertBlock( 'Cover' );
|
46
|
-
// Get the first color option from the block placeholder's color picker
|
46
|
+
// Get the first color option from the block placeholder's color picker.
|
47
47
|
const colorPickerButton = await page.waitForSelector(
|
48
48
|
'.wp-block-cover__placeholder-background-options .components-circular-option-picker__option-wrapper:first-child button'
|
49
49
|
);
|
50
|
-
// Get the RGB value of the picked color
|
50
|
+
// Get the RGB value of the picked color.
|
51
51
|
const pickedColor = await colorPickerButton.evaluate(
|
52
52
|
( node ) => node.style.backgroundColor
|
53
53
|
);
|
54
|
-
// Create the block by clicking selected color button
|
54
|
+
// Create the block by clicking selected color button.
|
55
55
|
await colorPickerButton.click();
|
56
|
-
// Get the block's background dim element
|
56
|
+
// Get the block's background dim element.
|
57
57
|
const backgroundDim = await page.waitForSelector(
|
58
58
|
'.wp-block-cover .has-background-dim'
|
59
59
|
);
|
60
|
-
// Get the RGB value of the background dim
|
60
|
+
// Get the RGB value of the background dim.
|
61
61
|
const dimColor = await backgroundDim.evaluate(
|
62
62
|
( node ) => node.style.backgroundColor
|
63
63
|
);
|
@@ -67,9 +67,9 @@ describe( 'Cover', () => {
|
|
67
67
|
|
68
68
|
it( 'can set background image using image upload on block placeholder', async () => {
|
69
69
|
await insertBlock( 'Cover' );
|
70
|
-
// Create the block using uploaded image
|
70
|
+
// Create the block using uploaded image.
|
71
71
|
const sourceImageFilename = await upload( '.wp-block-cover' );
|
72
|
-
// Get the block's background image URL
|
72
|
+
// Get the block's background image URL.
|
73
73
|
const blockImage = await page.waitForSelector( '.wp-block-cover img' );
|
74
74
|
const blockImageUrl = await blockImage.evaluate( ( el ) => el.src );
|
75
75
|
|
@@ -78,9 +78,9 @@ describe( 'Cover', () => {
|
|
78
78
|
|
79
79
|
it( 'dims background image down by 50% by default', async () => {
|
80
80
|
await insertBlock( 'Cover' );
|
81
|
-
// Create the block using uploaded image
|
81
|
+
// Create the block using uploaded image.
|
82
82
|
await upload( '.wp-block-cover' );
|
83
|
-
// Get the block's background dim color and its opacity
|
83
|
+
// Get the block's background dim color and its opacity.
|
84
84
|
const backgroundDim = await page.waitForSelector(
|
85
85
|
'.wp-block-cover .has-background-dim'
|
86
86
|
);
|
@@ -98,17 +98,17 @@ describe( 'Cover', () => {
|
|
98
98
|
|
99
99
|
it( 'can have the title edited', async () => {
|
100
100
|
await insertBlock( 'Cover' );
|
101
|
-
// Click first color option from the block placeholder's color picker
|
101
|
+
// Click first color option from the block placeholder's color picker.
|
102
102
|
const colorPickerButton = await page.waitForSelector(
|
103
103
|
'.wp-block-cover__placeholder-background-options .components-circular-option-picker__option-wrapper:first-child button'
|
104
104
|
);
|
105
105
|
await colorPickerButton.click();
|
106
|
-
// Click the title placeholder to put the cursor inside
|
106
|
+
// Click the title placeholder to put the cursor inside.
|
107
107
|
const coverTitle = await page.waitForSelector(
|
108
108
|
'.wp-block-cover .wp-block-paragraph'
|
109
109
|
);
|
110
110
|
await coverTitle.click();
|
111
|
-
// Type the title
|
111
|
+
// Type the title.
|
112
112
|
await page.keyboard.type( 'foo' );
|
113
113
|
const coverTitleText = await coverTitle.evaluate(
|
114
114
|
( el ) => el.innerText
|
@@ -119,9 +119,9 @@ describe( 'Cover', () => {
|
|
119
119
|
|
120
120
|
it( 'can be resized using drag & drop', async () => {
|
121
121
|
await insertBlock( 'Cover' );
|
122
|
-
// Close the inserter
|
122
|
+
// Close the inserter.
|
123
123
|
await page.click( '.edit-post-header-toolbar__inserter-toggle' );
|
124
|
-
// Open the sidebar
|
124
|
+
// Open the sidebar.
|
125
125
|
await openDocumentSettingsSidebar();
|
126
126
|
// Choose the first solid color as the background of the cover.
|
127
127
|
await page.click(
|
@@ -140,7 +140,7 @@ describe( 'Cover', () => {
|
|
140
140
|
)
|
141
141
|
)[ 0 ];
|
142
142
|
|
143
|
-
// Verify the height of the cover is not defined
|
143
|
+
// Verify the height of the cover is not defined.
|
144
144
|
expect(
|
145
145
|
await page.evaluate( ( { value } ) => value, heightInput )
|
146
146
|
).toBeFalsy();
|
@@ -195,7 +195,7 @@ describe( 'Cover', () => {
|
|
195
195
|
|
196
196
|
it( 'dims the background image down by 50% when transformed from the Image block', async () => {
|
197
197
|
await insertBlock( 'Image' );
|
198
|
-
// Upload image and transform to the Cover block
|
198
|
+
// Upload image and transform to the Cover block.
|
199
199
|
const filename = await upload( '.wp-block-image' );
|
200
200
|
await page.waitForSelector(
|
201
201
|
`.wp-block-image img[src$="${ filename }.png"]`
|
@@ -206,7 +206,7 @@ describe( 'Cover', () => {
|
|
206
206
|
await page.focus( '.wp-block-image' );
|
207
207
|
await transformBlockTo( 'Cover' );
|
208
208
|
|
209
|
-
// Get the block's background dim color and its opacity
|
209
|
+
// Get the block's background dim color and its opacity.
|
210
210
|
const backgroundDim = await page.waitForSelector(
|
211
211
|
'.wp-block-cover .has-background-dim'
|
212
212
|
);
|
@@ -103,9 +103,10 @@ describe( 'Image', () => {
|
|
103
103
|
`<!-- wp:image {"id":\\d+,"sizeSlug":"full","linkDestination":"none"} -->\\s*<figure class="wp-block-image size-full"><img src="[^"]+\\/${ filename2 }\\.png" alt="" class="wp-image-\\d+"/></figure>\\s*<!-- \\/wp:image -->`
|
104
104
|
);
|
105
105
|
expect( await getEditedPostContent() ).toMatch( regex3 );
|
106
|
-
//
|
107
|
-
//
|
108
|
-
await page.click( '.wp-block-
|
106
|
+
// Focus outside the block to avoid the image caption being selected
|
107
|
+
// It can happen on CI specially.
|
108
|
+
await page.click( '.wp-block-post-title' );
|
109
|
+
await page.click( '.wp-block-image img' );
|
109
110
|
await page.keyboard.press( 'Backspace' );
|
110
111
|
|
111
112
|
expect( await getEditedPostContent() ).toBe( '' );
|
@@ -118,7 +118,7 @@ describe( 'List', () => {
|
|
118
118
|
await page.keyboard.press( 'ArrowDown' );
|
119
119
|
await page.keyboard.press( 'Backspace' );
|
120
120
|
|
121
|
-
// Expect list to be deleted
|
121
|
+
// Expect list to be deleted.
|
122
122
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
123
123
|
} );
|
124
124
|
|