Skip to content

Commit 2761b62

Browse files
committed
E2E test updates.
1 parent bc62979 commit 2761b62

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/cypress/e2e/mailchimp-block.test.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,13 @@ describe('Block Tests', () => {
119119
it('Admin can show/hide groups from block settings', () => {
120120
// Show groups
121121
cy.visit(`/wp-admin/post.php?post=${postId}&action=edit`);
122-
cy.getBlockEditor().find('h2[aria-label="Enter a header (optional)"]').click();
123-
cy.openDocumentSettingsPanel('Settings', 'Block');
124-
cy.get('.mailchimp-interest-groups input.components-form-toggle__input').first().check();
122+
cy.getBlockEditor().find('div[data-title="Email Field"]').click();
123+
cy.getBlockEditor().find('.mc_interests_header label').first().click();
124+
cy.get('.block-editor-block-toolbar__slot').should('be.visible');
125125

126+
cy.get('.block-editor-block-toolbar__slot')
127+
.find('button[aria-label="Visibility"].is-pressed')
128+
.click();
126129
cy.get('button.editor-post-publish-button').click();
127130
cy.wait(500);
128131

@@ -133,10 +136,11 @@ describe('Block Tests', () => {
133136

134137
// Hide groups
135138
cy.visit(`/wp-admin/post.php?post=${postId}&action=edit`);
136-
cy.getBlockEditor().find('h2[aria-label="Enter a header (optional)"]').click();
137-
cy.openDocumentSettingsPanel('Settings', 'Block');
138-
cy.get('.mailchimp-interest-groups input.components-form-toggle__input').first().uncheck();
139+
cy.getBlockEditor().find('div[data-title="Email Field"]').click();
140+
cy.getBlockEditor().find('.mc_interests_header label').first().click();
141+
cy.get('.block-editor-block-toolbar__slot').should('be.visible');
139142

143+
cy.get('.block-editor-block-toolbar__slot').find('button[aria-label="Visibility"]').click();
140144
cy.get('button.editor-post-publish-button').click();
141145
cy.wait(500);
142146

0 commit comments

Comments
 (0)