Skip to content

Commit

Permalink
fix: requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rink9 committed Jul 16, 2022
1 parent 08dbdd8 commit 630bfd1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@ test.describe( 'WP Editor Meta Boxes', () => {
await page.type( '.editor-post-title__input', 'Hello Meta' );

// Type something.
await page.click( '#test_tinymce_id-html' );
await page.click( 'role=button[name="Text"i]' );
await page.click( '#test_tinymce_id' );
await page.keyboard.type( 'Typing in a metabox' );
await page.type( '#test_tinymce_id-html', 'Typing in a metabox' );
await page.click( '#test_tinymce_id-tmce' );
await page.click( 'role=button[name="Visual"i]' );

await editor.publishPost();

await expect( page.locator( '.edit-post-layout' ) ).toBeVisible();

await page.click( '#test_tinymce_id-html' );
const content = await page.$eval(
'#test_tinymce_id',
( textarea ) => textarea.value
);
await page.click( 'role=button[name="Text"i]' );

/*
* `content` may or may not contain the <p> tags depending on hasWpautop value in this line:
Expand All @@ -52,6 +48,9 @@ test.describe( 'WP Editor Meta Boxes', () => {
*
* For more context, see https://github.com/WordPress/gutenberg/pull/33228/files#r666897885
*/
expect( content ).toBe( 'Typing in a metabox' );
const content = page.locator( '#test_tinymce_id' );
expect( await content.evaluate( ( node ) => node.value ) ).toBe(
'Typing in a metabox'
);
} );
} );

0 comments on commit 630bfd1

Please sign in to comment.