Skip to content

Commit f2231a0

Browse files
authored
Merge branch 'develop' into feature/content-search-debounce
2 parents c96d136 + 6a71eb4 commit f2231a0

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

cypress/e2e/PostMeta.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ context('Post Meta', () => {
2525
// Author
2626
cy.get('.wp-block-example-post-meta .block-editor-block-variation-picker__variation').first().click();
2727

28-
cy.get('.wp-block-example-post-meta .block-editor-rich-text__editable[metakey="author"]').focus().clear().type('This is a test');
29-
cy.get('.wp-block-example-post-meta .block-editor-rich-text__editable[metakey="author"]').should('have.text', 'This is a test');
28+
cy.get('.wp-block-example-post-meta .block-editor-rich-text__editable').focus().clear().type('This is a test');
29+
cy.get('.wp-block-example-post-meta .block-editor-rich-text__editable').should('have.text', 'This is a test');
3030
})
3131

3232
it('Allows a number to be entered into the post meta field', () => {
@@ -49,7 +49,7 @@ context('Post Meta', () => {
4949
it('Saves the data into post meta', () => {
5050
// Author
5151
cy.get('.wp-block-example-post-meta .block-editor-block-variation-picker__variation').first().click();
52-
cy.get('.wp-block-example-post-meta .block-editor-rich-text__editable[metakey="author"]').focus().clear().type('This is a test');
52+
cy.get('.wp-block-example-post-meta .block-editor-rich-text__editable').focus().clear().type('This is a test');
5353

5454
// Reset
5555
cy.get('.block-editor-block-breadcrumb__button').contains('Book').click();

cypress/support/commands.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,14 @@ Cypress.Commands.add('savePost', () => {
8282
});
8383

8484
Cypress.Commands.add('insertBlock', (blockName) => {
85-
cy.get('button[aria-label="Add block"]').first().click();
86-
cy.focused().type(blockName);
87-
cy.get('.block-editor-inserter__quick-inserter-results button').contains(blockName).click();
85+
cy.get('button[aria-label="Toggle block inserter"]').first().then($button => {
86+
if ($button.attr('aria-pressed') !== 'true') {
87+
cy.wrap($button).click();
88+
}
89+
});
90+
cy.get('.components-input-control__input').first().clear();
91+
cy.get('.components-input-control__input').first().type(blockName);
92+
cy.get('.block-editor-block-types-list__item').contains(blockName).click();
8893
});
8994

9095
Cypress.Commands.add('openSettingsSidebar', () => {

example/src/blocks/post-meta/edit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const BlockEdit = (props) => {
4848

4949
return (
5050
<div {...blockProps}>
51-
<PostContext postId={postId} postType={postType}>
51+
<PostContext postId={postId} postType={postType} isEditable={true}>
5252
<PostMeta metaKey={metaKey} placeholder="Meta Value" />
5353
</PostContext>
5454
</div>

0 commit comments

Comments
 (0)