Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate New Default Post Content Test to Playwright #45267

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Addressed feedbacks
  • Loading branch information
pooja-muchandikar committed Oct 26, 2022
commit ce9c9abc3ccc35df2866247d19705eec80868186
10 changes: 8 additions & 2 deletions test/e2e/specs/editor/various/new-post-default-content.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* WordPress dependencies
*/
/**
* WordPress dependencies
*/
Expand All @@ -18,18 +21,21 @@ test.describe( 'new editor filtered state', () => {
await requestUtils.deactivatePlugin(
'gutenberg-test-plugin-default-post-content'
);
await requestUtils.deleteAllPosts();
} );

test( 'should respect default content', async ( { editor, page } ) => {
const content = await editor.getEditedPostContent();
Mamaduka marked this conversation as resolved.
Show resolved Hide resolved

await editor.openDocumentSettingsSidebar();
await page.click( 'role=button[name="Excerpt"i]' );
Mamaduka marked this conversation as resolved.
Show resolved Hide resolved

// Assert they match what the plugin set.
await expect(
page.locator( 'role=textbox[name="Add title"i]' )
).toHaveText( 'My default title' );
expect( content ).toBe( 'My default content' );
await expect
.poll( editor.getEditedPostContent )
.toBe( 'My default content' );
await expect(
page.locator( 'role=textbox[name="Write an excerpt (optional)"i]' )
).toHaveText( 'My default excerpt' );
Expand Down