-
Notifications
You must be signed in to change notification settings - Fork 4k
/
container-blocks.spec.js
50 lines (43 loc) · 1.18 KB
/
container-blocks.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );
test.describe( 'Container block without paragraph support', () => {
test.beforeAll( async ( { requestUtils } ) => {
await requestUtils.activatePlugin(
'gutenberg-test-container-block-without-paragraph'
);
} );
test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );
test.afterAll( async ( { requestUtils } ) => {
await requestUtils.deactivatePlugin(
'gutenberg-test-container-block-without-paragraph'
);
} );
test( 'ensures we can use the alternative block appender properly', async ( {
editor,
page,
} ) => {
await editor.insertBlock( {
name: 'test/container-without-paragraph',
} );
await page
.getByRole( 'document', {
name: 'Block: Container without paragraph',
} )
.getByRole( 'button', { name: 'Add block' } )
.click();
await page
.getByRole( 'listbox', { name: 'Blocks' } )
.getByRole( 'option', { name: 'Image' } )
.click();
await expect.poll( editor.getBlocks ).toMatchObject( [
{
name: 'test/container-without-paragraph',
innerBlocks: [ { name: 'core/image' } ],
},
] );
} );
} );