File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,22 @@ describe('Block Tests', () => {
246
246
} ) ;
247
247
} ) ;
248
248
249
+ it ( 'Form data should persist if validation fails' , ( ) => {
250
+ // Verify
251
+ const firstName = 'John' ;
252
+ const lastName = 'Doe' ;
253
+ cy . visit ( `/?p=${ postId } ` ) ;
254
+ cy . get ( '#mc_mv_EMAIL' ) . should ( 'exist' ) ;
255
+ cy . get ( '#mc_mv_FNAME' ) . clear ( ) . type ( firstName ) ;
256
+ cy . get ( '#mc_mv_LNAME' ) . clear ( ) . type ( lastName ) ;
257
+ cy . get ( '#mc_signup_submit' ) . should ( 'exist' ) ;
258
+ cy . get ( '#mc_signup_submit' ) . click ( ) ;
259
+ cy . get ( '.mc_error_msg' ) . should ( 'exist' ) ;
260
+ cy . get ( '.mc_error_msg' ) . contains ( 'Email Address: This value should not be blank.' ) ;
261
+ cy . get ( '#mc_mv_FNAME' ) . should ( 'have.value' , firstName ) ;
262
+ cy . get ( '#mc_mv_LNAME' ) . should ( 'have.value' , lastName ) ;
263
+ } ) ;
264
+
249
265
// TODO: Add tests for the Double Opt-in and Update existing subscribers settings.
250
266
// TODO: Add tests for the block styles settings.
251
267
// TODO: Add tests for the form submission.
You can’t perform that action at this time.
0 commit comments