@wordpress/e2e-tests 7.13.8 → 7.15.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/CHANGELOG.md +4 -0
- package/package.json +7 -7
- package/plugins/iframed-inline-styles.php +0 -7
- package/plugins/iframed-masonry-block.php +0 -7
- package/plugins/iframed-multiple-stylesheets.php +0 -7
- package/specs/editor/various/change-detection.test.js +1 -0
- package/specs/editor/various/datepicker.test.js +1 -3
- package/specs/editor/various/scheduling.test.js +1 -3
- package/specs/editor/blocks/post-title.test.js +0 -36
- package/specs/editor/plugins/__snapshots__/iframed-inline-styles.test.js.snap +0 -7
- package/specs/editor/plugins/__snapshots__/iframed-masonry-block.test.js.snap +0 -7
- package/specs/editor/plugins/iframed-enqueue-block-editor-settings.test.js +0 -108
- package/specs/editor/plugins/iframed-inline-styles.test.js +0 -56
- package/specs/editor/plugins/iframed-masonry-block.test.js +0 -49
- package/specs/editor/plugins/iframed-multiple-block-stylesheets.test.js +0 -58
- package/specs/editor/various/__snapshots__/keyboard-navigable-blocks.test.js.snap +0 -19
- package/specs/editor/various/__snapshots__/links.test.js.snap +0 -49
- package/specs/editor/various/format-library/__snapshots__/text-color.test.js.snap +0 -13
- package/specs/editor/various/format-library/text-color.test.js +0 -46
- package/specs/editor/various/keyboard-navigable-blocks.test.js +0 -239
- package/specs/editor/various/links.test.js +0 -916
- package/specs/local/demo.test.js +0 -50
- package/specs/site-editor/global-styles-sidebar.test.js +0 -45
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.15.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": ">=14"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@wordpress/e2e-test-utils": "^10.
|
27
|
-
"@wordpress/jest-console": "^7.
|
28
|
-
"@wordpress/jest-puppeteer-axe": "^6.
|
29
|
-
"@wordpress/scripts": "^26.
|
30
|
-
"@wordpress/url": "^3.
|
26
|
+
"@wordpress/e2e-test-utils": "^10.15.0",
|
27
|
+
"@wordpress/jest-console": "^7.15.0",
|
28
|
+
"@wordpress/jest-puppeteer-axe": "^6.15.0",
|
29
|
+
"@wordpress/scripts": "^26.15.0",
|
30
|
+
"@wordpress/url": "^3.45.0",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
33
33
|
"filenamify": "^4.2.0",
|
@@ -45,5 +45,5 @@
|
|
45
45
|
"publishConfig": {
|
46
46
|
"access": "public"
|
47
47
|
},
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "f83bb1a71e8fa416131b81a9f282a72a1dc6c694"
|
49
49
|
}
|
@@ -349,6 +349,7 @@ describe( 'Change detection', () => {
|
|
349
349
|
// Trash post.
|
350
350
|
await openDocumentSettingsSidebar();
|
351
351
|
await page.click( '.editor-post-trash.components-button' );
|
352
|
+
await page.click( '.components-confirm-dialog .is-primary' );
|
352
353
|
|
353
354
|
await Promise.all( [
|
354
355
|
// Wait for "Saved" to confirm save complete.
|
@@ -61,9 +61,7 @@ async function getPublishingDate() {
|
|
61
61
|
);
|
62
62
|
}
|
63
63
|
|
64
|
-
|
65
|
-
// See: https://github.com/WordPress/gutenberg/pull/54806#issuecomment-1734840171.
|
66
|
-
describe.each( [ [ 'UTC-10' ], [ 'UTC+1' ], [ 'UTC+10' ] ] )(
|
64
|
+
describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
|
67
65
|
`Datepicker %s`,
|
68
66
|
( timezone ) => {
|
69
67
|
let oldTimezone;
|
@@ -23,9 +23,7 @@ describe( 'Scheduling', () => {
|
|
23
23
|
} );
|
24
24
|
};
|
25
25
|
|
26
|
-
|
27
|
-
// See: https://github.com/WordPress/gutenberg/pull/54806#issuecomment-1734840171.
|
28
|
-
describe.each( [ [ 'UTC-10' ], [ 'UTC+1' ], [ 'UTC+10' ] ] )(
|
26
|
+
describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
|
29
27
|
`Timezone %s`,
|
30
28
|
( timezone ) => {
|
31
29
|
let oldTimezone;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
createNewPost,
|
6
|
-
insertBlock,
|
7
|
-
saveDraft,
|
8
|
-
canvas,
|
9
|
-
} from '@wordpress/e2e-test-utils';
|
10
|
-
|
11
|
-
describe( 'Post Title block', () => {
|
12
|
-
beforeEach( async () => {
|
13
|
-
await createNewPost();
|
14
|
-
} );
|
15
|
-
|
16
|
-
it( 'Can edit the post title', async () => {
|
17
|
-
// Create a block with some text that will trigger a list creation.
|
18
|
-
await insertBlock( 'Title' );
|
19
|
-
const editablePostTitleSelector =
|
20
|
-
'.wp-block-post-title[contenteditable="true"]';
|
21
|
-
await canvas().waitForSelector( editablePostTitleSelector );
|
22
|
-
await canvas().focus( editablePostTitleSelector );
|
23
|
-
|
24
|
-
// Create a second list item.
|
25
|
-
await page.keyboard.type( 'Just tweaking the post title' );
|
26
|
-
|
27
|
-
await saveDraft();
|
28
|
-
await page.reload();
|
29
|
-
await page.waitForSelector( '.edit-post-layout' );
|
30
|
-
const title = await canvas().$eval(
|
31
|
-
'.editor-post-title__input',
|
32
|
-
( element ) => element.textContent
|
33
|
-
);
|
34
|
-
expect( title ).toEqual( 'Just tweaking the post title' );
|
35
|
-
} );
|
36
|
-
} );
|
@@ -1,7 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`iframed inline styles should load inline styles in iframe 1`] = `
|
4
|
-
"<!-- wp:test/iframed-inline-styles -->
|
5
|
-
<div class="wp-block-test-iframed-inline-styles">Save</div>
|
6
|
-
<!-- /wp:test/iframed-inline-styles -->"
|
7
|
-
`;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`iframed masonry block should load script and dependencies in iframe 1`] = `
|
4
|
-
"<!-- wp:test/iframed-masonry-block -->
|
5
|
-
<div class="wp-block-test-iframed-masonry-block"><div class="grid-item"></div><div class="grid-item grid-item--width2 grid-item--height2"></div><div class="grid-item grid-item--height3"></div><div class="grid-item grid-item--height2"></div><div class="grid-item grid-item--width3"></div><div class="grid-item"></div><div class="grid-item"></div><div class="grid-item grid-item--height2"></div><div class="grid-item grid-item--width2 grid-item--height3"></div><div class="grid-item"></div><div class="grid-item grid-item--height2"></div><div class="grid-item"></div><div class="grid-item grid-item--width2 grid-item--height2"></div><div class="grid-item grid-item--width2"></div><div class="grid-item"></div><div class="grid-item grid-item--height2"></div><div class="grid-item"></div><div class="grid-item"></div><div class="grid-item grid-item--height3"></div><div class="grid-item grid-item--height2"></div><div class="grid-item"></div><div class="grid-item"></div><div class="grid-item grid-item--height2"></div></div>
|
6
|
-
<!-- /wp:test/iframed-masonry-block -->"
|
7
|
-
`;
|
@@ -1,108 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
activatePlugin,
|
6
|
-
createNewPost,
|
7
|
-
deactivatePlugin,
|
8
|
-
canvas,
|
9
|
-
activateTheme,
|
10
|
-
} from '@wordpress/e2e-test-utils';
|
11
|
-
|
12
|
-
async function getComputedStyle( context, selector, property ) {
|
13
|
-
return await context.evaluate(
|
14
|
-
( sel, prop ) =>
|
15
|
-
window.getComputedStyle( document.querySelector( sel ) )[ prop ],
|
16
|
-
selector,
|
17
|
-
property
|
18
|
-
);
|
19
|
-
}
|
20
|
-
|
21
|
-
describe( 'iframed block editor settings styles', () => {
|
22
|
-
beforeEach( async () => {
|
23
|
-
// Activate the empty theme (block based theme), which is iframed.
|
24
|
-
await activateTheme( 'emptytheme' );
|
25
|
-
await activatePlugin(
|
26
|
-
'gutenberg-test-iframed-enqueue-block-editor-settings'
|
27
|
-
);
|
28
|
-
await createNewPost();
|
29
|
-
} );
|
30
|
-
|
31
|
-
afterEach( async () => {
|
32
|
-
await deactivatePlugin(
|
33
|
-
'gutenberg-test-iframed-enqueue-block-editor-settings'
|
34
|
-
);
|
35
|
-
await activateTheme( 'twentytwentyone' );
|
36
|
-
} );
|
37
|
-
|
38
|
-
it( 'should load styles added through block editor settings', async () => {
|
39
|
-
await page.waitForSelector( 'iframe[name="editor-canvas"]' );
|
40
|
-
// Expect a red border (added in PHP).
|
41
|
-
expect( await getComputedStyle( canvas(), 'p', 'border-color' ) ).toBe(
|
42
|
-
'rgb(255, 0, 0)'
|
43
|
-
);
|
44
|
-
|
45
|
-
await page.evaluate( () => {
|
46
|
-
const settings = window.wp.data
|
47
|
-
.select( 'core/editor' )
|
48
|
-
.getEditorSettings();
|
49
|
-
wp.data.dispatch( 'core/editor' ).updateEditorSettings( {
|
50
|
-
...settings,
|
51
|
-
styles: [
|
52
|
-
...settings.styles,
|
53
|
-
{
|
54
|
-
css: 'p { border-width: 2px; }',
|
55
|
-
__unstableType: 'plugin',
|
56
|
-
},
|
57
|
-
],
|
58
|
-
} );
|
59
|
-
} );
|
60
|
-
|
61
|
-
// Expect a 2px border (added in JS).
|
62
|
-
expect( await getComputedStyle( canvas(), 'p', 'border-width' ) ).toBe(
|
63
|
-
'2px'
|
64
|
-
);
|
65
|
-
} );
|
66
|
-
|
67
|
-
it( 'should load theme styles added through block editor settings', async () => {
|
68
|
-
await page.waitForSelector( 'iframe[name="editor-canvas"]' );
|
69
|
-
|
70
|
-
await page.evaluate( () => {
|
71
|
-
// Make sure that theme styles are added even if the theme styles
|
72
|
-
// preference is off.
|
73
|
-
window.wp.data
|
74
|
-
.dispatch( 'core/edit-post' )
|
75
|
-
.toggleFeature( 'themeStyles' );
|
76
|
-
const settings = window.wp.data
|
77
|
-
.select( 'core/editor' )
|
78
|
-
.getEditorSettings();
|
79
|
-
wp.data.dispatch( 'core/editor' ).updateEditorSettings( {
|
80
|
-
...settings,
|
81
|
-
styles: [
|
82
|
-
...settings.styles,
|
83
|
-
{
|
84
|
-
css: 'p { border-width: 2px; }',
|
85
|
-
__unstableType: 'theme',
|
86
|
-
},
|
87
|
-
],
|
88
|
-
} );
|
89
|
-
} );
|
90
|
-
|
91
|
-
// Expect a 1px border because theme styles are disabled.
|
92
|
-
expect( await getComputedStyle( canvas(), 'p', 'border-width' ) ).toBe(
|
93
|
-
'1px'
|
94
|
-
);
|
95
|
-
|
96
|
-
await page.evaluate( () => {
|
97
|
-
// Now enable theme styles.
|
98
|
-
window.wp.data
|
99
|
-
.dispatch( 'core/edit-post' )
|
100
|
-
.toggleFeature( 'themeStyles' );
|
101
|
-
} );
|
102
|
-
|
103
|
-
// Expect a 2px border because theme styles are enabled.
|
104
|
-
expect( await getComputedStyle( canvas(), 'p', 'border-width' ) ).toBe(
|
105
|
-
'2px'
|
106
|
-
);
|
107
|
-
} );
|
108
|
-
} );
|
@@ -1,56 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
activatePlugin,
|
6
|
-
createNewPost,
|
7
|
-
deactivatePlugin,
|
8
|
-
insertBlock,
|
9
|
-
getEditedPostContent,
|
10
|
-
canvas,
|
11
|
-
createNewTemplate,
|
12
|
-
} from '@wordpress/e2e-test-utils';
|
13
|
-
|
14
|
-
async function getComputedStyle( context, property ) {
|
15
|
-
await context.waitForSelector( '.wp-block-test-iframed-inline-styles' );
|
16
|
-
return await context.evaluate( ( prop ) => {
|
17
|
-
const container = document.querySelector(
|
18
|
-
'.wp-block-test-iframed-inline-styles'
|
19
|
-
);
|
20
|
-
return window.getComputedStyle( container )[ prop ];
|
21
|
-
}, property );
|
22
|
-
}
|
23
|
-
|
24
|
-
describe( 'iframed inline styles', () => {
|
25
|
-
beforeEach( async () => {
|
26
|
-
await activatePlugin( 'gutenberg-test-iframed-inline-styles' );
|
27
|
-
await createNewPost( { postType: 'page' } );
|
28
|
-
} );
|
29
|
-
|
30
|
-
afterEach( async () => {
|
31
|
-
await deactivatePlugin( 'gutenberg-test-iframed-inline-styles' );
|
32
|
-
} );
|
33
|
-
|
34
|
-
it( 'should load inline styles in iframe', async () => {
|
35
|
-
await insertBlock( 'Iframed Inline Styles' );
|
36
|
-
|
37
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
38
|
-
expect( await getComputedStyle( canvas(), 'padding' ) ).toBe( '20px' );
|
39
|
-
expect( await getComputedStyle( canvas(), 'border-width' ) ).toBe(
|
40
|
-
'2px'
|
41
|
-
);
|
42
|
-
|
43
|
-
await createNewTemplate( 'Iframed Test' );
|
44
|
-
|
45
|
-
// Inline styles of properly enqueued stylesheet should load.
|
46
|
-
expect( await getComputedStyle( canvas(), 'padding' ) ).toBe( '20px' );
|
47
|
-
|
48
|
-
// Inline styles of stylesheet loaded with the compatibility layer
|
49
|
-
// should load.
|
50
|
-
expect( await getComputedStyle( canvas(), 'border-width' ) ).toBe(
|
51
|
-
'2px'
|
52
|
-
);
|
53
|
-
|
54
|
-
expect( console ).toHaveWarned();
|
55
|
-
} );
|
56
|
-
} );
|
@@ -1,49 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
activatePlugin,
|
6
|
-
createNewPost,
|
7
|
-
deactivatePlugin,
|
8
|
-
insertBlock,
|
9
|
-
getEditedPostContent,
|
10
|
-
canvas,
|
11
|
-
createNewTemplate,
|
12
|
-
} from '@wordpress/e2e-test-utils';
|
13
|
-
|
14
|
-
async function didMasonryLoadCorrectly( context ) {
|
15
|
-
return await context.evaluate( () => {
|
16
|
-
const container = document.querySelector(
|
17
|
-
'.wp-block-test-iframed-masonry-block'
|
18
|
-
);
|
19
|
-
return (
|
20
|
-
// Expect Masonry to set a non-zero height.
|
21
|
-
parseInt( container.style.height, 10 ) > 0 &&
|
22
|
-
// Expect Masonry to absolute position items.
|
23
|
-
container.firstElementChild.style.position === 'absolute'
|
24
|
-
);
|
25
|
-
} );
|
26
|
-
}
|
27
|
-
|
28
|
-
describe( 'iframed masonry block', () => {
|
29
|
-
beforeEach( async () => {
|
30
|
-
await activatePlugin( 'gutenberg-test-iframed-masonry-block' );
|
31
|
-
await createNewPost( { postType: 'page' } );
|
32
|
-
} );
|
33
|
-
|
34
|
-
afterEach( async () => {
|
35
|
-
await deactivatePlugin( 'gutenberg-test-iframed-masonry-block' );
|
36
|
-
} );
|
37
|
-
|
38
|
-
it( 'should load script and dependencies in iframe', async () => {
|
39
|
-
await insertBlock( 'Iframed Masonry Block' );
|
40
|
-
|
41
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
42
|
-
expect( await didMasonryLoadCorrectly( canvas() ) ).toBe( true );
|
43
|
-
|
44
|
-
await createNewTemplate( 'Iframed Test' );
|
45
|
-
await canvas().waitForSelector( '.grid-item[style]' );
|
46
|
-
|
47
|
-
expect( await didMasonryLoadCorrectly( canvas() ) ).toBe( true );
|
48
|
-
} );
|
49
|
-
} );
|
@@ -1,58 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
activatePlugin,
|
6
|
-
createNewPost,
|
7
|
-
deactivatePlugin,
|
8
|
-
insertBlock,
|
9
|
-
canvas,
|
10
|
-
createNewTemplate,
|
11
|
-
} from '@wordpress/e2e-test-utils';
|
12
|
-
|
13
|
-
async function getComputedStyle( context, property ) {
|
14
|
-
await context.waitForSelector(
|
15
|
-
'.wp-block-test-iframed-multiple-stylesheets'
|
16
|
-
);
|
17
|
-
return await context.evaluate( ( prop ) => {
|
18
|
-
const container = document.querySelector(
|
19
|
-
'.wp-block-test-iframed-multiple-stylesheets'
|
20
|
-
);
|
21
|
-
return window.getComputedStyle( container )[ prop ];
|
22
|
-
}, property );
|
23
|
-
}
|
24
|
-
|
25
|
-
describe( 'iframed multiple block stylesheets', () => {
|
26
|
-
beforeEach( async () => {
|
27
|
-
await activatePlugin( 'gutenberg-test-iframed-multiple-stylesheets' );
|
28
|
-
await createNewPost( { postType: 'page' } );
|
29
|
-
} );
|
30
|
-
|
31
|
-
afterEach( async () => {
|
32
|
-
await deactivatePlugin( 'gutenberg-test-iframed-multiple-stylesheets' );
|
33
|
-
} );
|
34
|
-
|
35
|
-
it( 'should load multiple block stylesheets in iframe', async () => {
|
36
|
-
await insertBlock( 'Iframed Multiple Stylesheets' );
|
37
|
-
|
38
|
-
await canvas().waitForSelector(
|
39
|
-
'.wp-block-test-iframed-multiple-stylesheets'
|
40
|
-
);
|
41
|
-
await createNewTemplate( 'Iframed Test' );
|
42
|
-
|
43
|
-
// Style loaded from the main stylesheet.
|
44
|
-
expect( await getComputedStyle( canvas(), 'border-style' ) ).toBe(
|
45
|
-
'dashed'
|
46
|
-
);
|
47
|
-
|
48
|
-
// Style loaded from the additional stylesheet.
|
49
|
-
expect( await getComputedStyle( canvas(), 'border-color' ) ).toBe(
|
50
|
-
'rgb(255, 0, 0)'
|
51
|
-
);
|
52
|
-
|
53
|
-
// Style loaded from the a stylesheet using path instead of handle.
|
54
|
-
expect( await getComputedStyle( canvas(), 'background-color' ) ).toBe(
|
55
|
-
'rgb(0, 0, 0)'
|
56
|
-
);
|
57
|
-
} );
|
58
|
-
} );
|
@@ -1,19 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`Order of block keyboard navigation should navigate correctly with multi selection 1`] = `
|
4
|
-
"<!-- wp:paragraph -->
|
5
|
-
<p>1</p>
|
6
|
-
<!-- /wp:paragraph -->
|
7
|
-
|
8
|
-
<!-- wp:paragraph -->
|
9
|
-
<p>2</p>
|
10
|
-
<!-- /wp:paragraph -->
|
11
|
-
|
12
|
-
<!-- wp:paragraph -->
|
13
|
-
<p>3</p>
|
14
|
-
<!-- /wp:paragraph -->
|
15
|
-
|
16
|
-
<!-- wp:paragraph -->
|
17
|
-
<p>4</p>
|
18
|
-
<!-- /wp:paragraph -->"
|
19
|
-
`;
|
@@ -1,49 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`Links allows use of escape key to dismiss the url popover 1`] = `
|
4
|
-
"<!-- wp:paragraph -->
|
5
|
-
<p>This is Gutenberg.</p>
|
6
|
-
<!-- /wp:paragraph -->"
|
7
|
-
`;
|
8
|
-
|
9
|
-
exports[`Links can be created by selecting text and clicking Link 1`] = `
|
10
|
-
"<!-- wp:paragraph -->
|
11
|
-
<p>This is <a href="https://wordpress.org/gutenberg">Gutenberg</a></p>
|
12
|
-
<!-- /wp:paragraph -->"
|
13
|
-
`;
|
14
|
-
|
15
|
-
exports[`Links can be created instantly when a URL is selected 1`] = `
|
16
|
-
"<!-- wp:paragraph -->
|
17
|
-
<p>This is Gutenberg: <a href="https://wordpress.org/gutenberg">https://wordpress.org/gutenberg</a></p>
|
18
|
-
<!-- /wp:paragraph -->"
|
19
|
-
`;
|
20
|
-
|
21
|
-
exports[`Links can be created without any text selected 1`] = `
|
22
|
-
"<!-- wp:paragraph -->
|
23
|
-
<p>This is Gutenberg: <a href="https://wordpress.org/gutenberg">https://wordpress.org/gutenberg</a></p>
|
24
|
-
<!-- /wp:paragraph -->"
|
25
|
-
`;
|
26
|
-
|
27
|
-
exports[`Links can be edited 1`] = `
|
28
|
-
"<!-- wp:paragraph -->
|
29
|
-
<p>This is <a href="https://wordpress.org/gutenberg/handbook">Gutenberg</a></p>
|
30
|
-
<!-- /wp:paragraph -->"
|
31
|
-
`;
|
32
|
-
|
33
|
-
exports[`Links can be edited with collapsed selection 1`] = `
|
34
|
-
"<!-- wp:paragraph -->
|
35
|
-
<p>This is <a href="https://wordpress.org/gutenberg/handbook">Gutenberg</a></p>
|
36
|
-
<!-- /wp:paragraph -->"
|
37
|
-
`;
|
38
|
-
|
39
|
-
exports[`Links can be modified using the keyboard once a link has been set 1`] = `
|
40
|
-
"<!-- wp:paragraph -->
|
41
|
-
<p>This is <a href="https://wordpress.org/gutenberg">Gutenberg</a>.</p>
|
42
|
-
<!-- /wp:paragraph -->"
|
43
|
-
`;
|
44
|
-
|
45
|
-
exports[`Links can be removed 1`] = `
|
46
|
-
"<!-- wp:paragraph -->
|
47
|
-
<p>This is Gutenberg</p>
|
48
|
-
<!-- /wp:paragraph -->"
|
49
|
-
`;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`RichText should remove highlighting element 1`] = `
|
4
|
-
"<!-- wp:paragraph -->
|
5
|
-
<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color">1</mark></p>
|
6
|
-
<!-- /wp:paragraph -->"
|
7
|
-
`;
|
8
|
-
|
9
|
-
exports[`RichText should remove highlighting element 2`] = `
|
10
|
-
"<!-- wp:paragraph -->
|
11
|
-
<p>1</p>
|
12
|
-
<!-- /wp:paragraph -->"
|
13
|
-
`;
|
@@ -1,46 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
createNewPost,
|
6
|
-
getEditedPostContent,
|
7
|
-
clickBlockAppender,
|
8
|
-
pressKeyWithModifier,
|
9
|
-
clickBlockToolbarButton,
|
10
|
-
} from '@wordpress/e2e-test-utils';
|
11
|
-
|
12
|
-
describe( 'RichText', () => {
|
13
|
-
beforeEach( async () => {
|
14
|
-
await createNewPost();
|
15
|
-
} );
|
16
|
-
|
17
|
-
it( 'should remove highlighting element', async () => {
|
18
|
-
await clickBlockAppender();
|
19
|
-
|
20
|
-
// Add text and select to color.
|
21
|
-
await page.keyboard.type( '1' );
|
22
|
-
await pressKeyWithModifier( 'primary', 'a' );
|
23
|
-
await clickBlockToolbarButton( 'More' );
|
24
|
-
|
25
|
-
const button = await page.waitForXPath(
|
26
|
-
`//button[text()='Highlight']`
|
27
|
-
);
|
28
|
-
// Clicks may fail if the button is out of view. Assure it is before click.
|
29
|
-
await button.evaluate( ( element ) => element.scrollIntoView() );
|
30
|
-
await button.click();
|
31
|
-
|
32
|
-
// Use a color name with multiple words to ensure that it becomes
|
33
|
-
// active. Previously we had a broken regular expression.
|
34
|
-
const option = await page.waitForSelector(
|
35
|
-
'[aria-label="Color: Cyan bluish gray"]'
|
36
|
-
);
|
37
|
-
|
38
|
-
await option.click();
|
39
|
-
|
40
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
41
|
-
|
42
|
-
await option.click();
|
43
|
-
|
44
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
45
|
-
} );
|
46
|
-
} );
|