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

Fix react 18 compatibility #3429

Merged
merged 4 commits into from
Apr 5, 2023
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
Check if block inserter is already open before re-opening it
  • Loading branch information
felipeelia committed Apr 5, 2023
commit 6a7c1372b9fd2411b3fae40c3cc59975054bd86e
10 changes: 7 additions & 3 deletions tests/cypress/support/commands/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ Cypress.Commands.add('openBlockSettingsSidebar', () => {
});

Cypress.Commands.add('openBlockInserter', () => {
cy.get('body').then(($el) => {
if ($el.hasClass('widgets-php')) {
cy.get('body').then(($body) => {
// If already open, skip.
if ($body.find('.edit-widgets-layout__inserter-panel-content').length > 0) {
return;
}
if ($body.hasClass('widgets-php')) {
cy.get('.edit-widgets-header-toolbar__inserter-toggle').click();
} else {
cy.get('.edit-post-header-toolbar__inserter-toggle').click();
Expand All @@ -25,6 +29,6 @@ Cypress.Commands.add('getBlocksList', () => {
});

Cypress.Commands.add('insertBlock', (blockName) => {
cy.get('.block-editor-inserter__search input[type="search"').type(blockName);
cy.get('.block-editor-inserter__search input[type="search"').clearThenType(blockName);
cy.get('.block-editor-block-types-list__item').contains(blockName).click();
});