@wordpress/e2e-tests 4.6.0 → 4.7.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.
@@ -1,36 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- activatePlugin,
6
- clickBlockAppender,
7
- clickBlockToolbarButton,
8
- createNewPost,
9
- deactivatePlugin,
10
- getEditedPostContent,
11
- pressKeyWithModifier,
12
- clickButton,
13
- } from '@wordpress/e2e-test-utils';
14
-
15
- describe( 'Using Format API', () => {
16
- beforeAll( async () => {
17
- await activatePlugin( 'gutenberg-test-format-api' );
18
- } );
19
-
20
- afterAll( async () => {
21
- await deactivatePlugin( 'gutenberg-test-format-api' );
22
- } );
23
-
24
- beforeEach( async () => {
25
- await createNewPost();
26
- } );
27
-
28
- it( 'Clicking the control wraps the selected text properly with HTML code', async () => {
29
- await clickBlockAppender();
30
- await page.keyboard.type( 'First paragraph' );
31
- await pressKeyWithModifier( 'shiftAlt', 'ArrowLeft' );
32
- await clickBlockToolbarButton( 'More' );
33
- await clickButton( 'Custom Link' );
34
- expect( await getEditedPostContent() ).toMatchSnapshot();
35
- } );
36
- } );
@@ -1,42 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createNewPost, showBlockToolbar } from '@wordpress/e2e-test-utils';
5
-
6
- describe( 'block mover', () => {
7
- beforeEach( async () => {
8
- await createNewPost();
9
- } );
10
-
11
- it( 'should show block mover when more than one block exists', async () => {
12
- // Create a two blocks on the page.
13
- await page.click( '.block-editor-default-block-appender' );
14
- await page.keyboard.type( 'First Paragraph' );
15
- await page.keyboard.press( 'Enter' );
16
- await page.keyboard.type( 'Second Paragraph' );
17
-
18
- // Select a block so the block mover is rendered.
19
- await page.focus( '[data-type="core/paragraph"]' );
20
-
21
- await showBlockToolbar();
22
-
23
- const blockMover = await page.$$( '.block-editor-block-mover' );
24
- // There should be a block mover.
25
- expect( blockMover ).toHaveLength( 1 );
26
- } );
27
-
28
- it( 'should hide block mover when only one block exists', async () => {
29
- // Create a single block on the page.
30
- await page.click( '.block-editor-default-block-appender' );
31
- await page.keyboard.type( 'First Paragraph' );
32
-
33
- // Select a block so the block mover has the possibility of being rendered.
34
- await page.focus( '.block-editor-block-list__block' );
35
-
36
- await showBlockToolbar();
37
-
38
- // Ensure no block mover exists when only one block exists on the page.
39
- const blockMover = await page.$$( '.block-editor-block-mover' );
40
- expect( blockMover ).toHaveLength( 0 );
41
- } );
42
- } );