@@ -34,8 +34,11 @@ describe('Block Tests', () => {
34
34
const subHeader =
35
35
'[BLOCK] Join our mailing list to receive the latest news and updates from our team.' ;
36
36
const button = 'Subscribe Now' ;
37
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header."]' ) . clear ( ) . type ( header ) ;
38
- cy . getBlockEditor ( ) . find ( 'h3[aria-label="Enter a sub header."]' ) . clear ( ) . type ( subHeader ) ;
37
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional)"]' ) . clear ( ) . type ( header ) ;
38
+ cy . getBlockEditor ( )
39
+ . find ( 'h3[aria-label="Enter a sub header (optional)"]' )
40
+ . clear ( )
41
+ . type ( subHeader ) ;
39
42
cy . getBlockEditor ( ) . find ( 'button[aria-label="Enter a button text."]' ) . clear ( ) . type ( button ) ;
40
43
cy . get ( 'button.editor-post-publish-button' ) . click ( ) ;
41
44
@@ -116,7 +119,7 @@ describe('Block Tests', () => {
116
119
it ( 'Admin can show/hide groups from block settings' , ( ) => {
117
120
// Show groups
118
121
cy . visit ( `/wp-admin/post.php?post=${ postId } &action=edit` ) ;
119
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header. "]' ) . click ( ) ;
122
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional) "]' ) . click ( ) ;
120
123
cy . openDocumentSettingsPanel ( 'Settings' , 'Block' ) ;
121
124
cy . get ( '.mailchimp-interest-groups input.components-form-toggle__input' ) . first ( ) . check ( ) ;
122
125
@@ -130,7 +133,7 @@ describe('Block Tests', () => {
130
133
131
134
// Hide groups
132
135
cy . visit ( `/wp-admin/post.php?post=${ postId } &action=edit` ) ;
133
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header. "]' ) . click ( ) ;
136
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional) "]' ) . click ( ) ;
134
137
cy . openDocumentSettingsPanel ( 'Settings' , 'Block' ) ;
135
138
cy . get ( '.mailchimp-interest-groups input.components-form-toggle__input' ) . first ( ) . uncheck ( ) ;
136
139
@@ -161,7 +164,7 @@ describe('Block Tests', () => {
161
164
it ( 'Admin can show/hide unsubscribe link from block settings' , ( ) => {
162
165
// display unsubscribe link.
163
166
cy . visit ( `/wp-admin/post.php?post=${ postId } &action=edit` ) ;
164
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header. "]' ) . click ( ) ;
167
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional) "]' ) . click ( ) ;
165
168
cy . openDocumentSettingsPanel ( 'Form Settings' , 'Block' ) ;
166
169
cy . get ( '.mailchimp-unsubscribe-link input.components-form-toggle__input' ) . first ( ) . check ( ) ;
167
170
cy . get ( 'button.editor-post-publish-button' ) . click ( ) ;
@@ -173,7 +176,7 @@ describe('Block Tests', () => {
173
176
174
177
// Reset
175
178
cy . visit ( `/wp-admin/post.php?post=${ postId } &action=edit` ) ;
176
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header. "]' ) . click ( ) ;
179
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional) "]' ) . click ( ) ;
177
180
cy . openDocumentSettingsPanel ( 'Form Settings' , 'Block' ) ;
178
181
cy . get ( '.mailchimp-unsubscribe-link input.components-form-toggle__input' ) . first ( ) . uncheck ( ) ;
179
182
cy . get ( 'button.editor-post-publish-button' ) . click ( ) ;
@@ -187,7 +190,7 @@ describe('Block Tests', () => {
187
190
it ( 'Admin can change audience list from block settings' , ( ) => {
188
191
// display unsubscribe link.
189
192
cy . visit ( `/wp-admin/post.php?post=${ postId } &action=edit` ) ;
190
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header. "]' ) . click ( ) ;
193
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional) "]' ) . click ( ) ;
191
194
cy . openDocumentSettingsPanel ( 'Settings' , 'Block' ) ;
192
195
cy . get ( '.mailchimp-list-select select' ) . select ( 'Alternate 10up Audience' ) ;
193
196
cy . wait ( 2000 ) ;
@@ -205,7 +208,7 @@ describe('Block Tests', () => {
205
208
206
209
// Reset
207
210
cy . visit ( `/wp-admin/post.php?post=${ postId } &action=edit` ) ;
208
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header. "]' ) . click ( ) ;
211
+ cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header (optional) "]' ) . click ( ) ;
209
212
cy . openDocumentSettingsPanel ( 'Settings' , 'Block' ) ;
210
213
cy . get ( '.mailchimp-list-select select' ) . select ( '10up' ) ;
211
214
cy . wait ( 2000 ) ;
@@ -226,7 +229,10 @@ describe('Block Tests', () => {
226
229
227
230
cy . visit ( `/wp-admin/post.php?post=${ oldBlockPostId } &action=edit` ) ;
228
231
const header = '[NEW BLOCK] Subscribe to our newsletter' ;
229
- cy . getBlockEditor ( ) . find ( 'h2[aria-label="Enter a header."]' ) . clear ( ) . type ( header ) ;
232
+ cy . getBlockEditor ( )
233
+ . find ( 'h2[aria-label="Enter a header (optional)"]' )
234
+ . clear ( )
235
+ . type ( header ) ;
230
236
cy . get ( 'button.editor-post-publish-button' ) . click ( ) ;
231
237
cy . wait ( 500 ) ;
232
238
0 commit comments