-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Expand file tree
/
Copy pathwp-editor-meta-box.test.js
More file actions
44 lines (36 loc) · 1.12 KB
/
wp-editor-meta-box.test.js
File metadata and controls
44 lines (36 loc) · 1.12 KB
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
/**
* WordPress dependencies
*/
import {
activatePlugin,
createNewPost,
deactivatePlugin,
publishPost,
} from '@wordpress/e2e-test-utils';
describe( 'WP Editor Meta Boxes', () => {
beforeAll( async () => {
await activatePlugin( 'gutenberg-test-plugin-wp-editor-meta-box' );
await createNewPost();
} );
afterAll( async () => {
await deactivatePlugin( 'gutenberg-test-plugin-wp-editor-meta-box' );
} );
it( 'Should save the changes', async () => {
// Add title to enable valid non-empty post save.
await page.type( '.editor-post-title__input', 'Hello Meta' );
// Type something
await expect( page ).toClick( '#test_tinymce_id-html' );
await page.type( '#test_tinymce_id', 'Typing in a metabox' );
await page.click( '#test_tinymce_id-tmce' );
await publishPost();
await page.reload();
await page.waitForSelector( '.edit-post-layout' );
await expect( page ).toClick( '#test_tinymce_id-html' );
await page.waitForSelector( '#test_tinymce_id' );
const content = await page.$eval(
'#test_tinymce_id',
( textarea ) => textarea.value
);
expect( content ).toBe( 'Typing in a metabox' );
} );
} );