@@ -29,7 +29,32 @@ describe('Admin can update plugin settings', () => {
29
29
cy . get ( '#mc-message .success_msg b' ) . contains ( 'Success!' ) ;
30
30
} ) ;
31
31
32
+ // TODO: BLOCKED - Need separate Mailchimp user to finish this test
33
+ it . skip ( 'Admin that has never saved a list can not see the form on the front end' , ( ) => {
34
+ // Step 1: Log the user out of the current account (if logged in)
35
+ cy . visit ( '/wp-admin/admin.php?page=mailchimp_sf_options' ) ;
36
+ cy . mailchimpLogout ( ) ;
37
+
38
+ // Verify the user is logged out
39
+ cy . get ( '#mailchimp_sf_oauth_connect' ) . should ( 'exist' ) ;
40
+
41
+ // Step 2: Log in with a test user account that has never saved a list
42
+ // TODO: BLOCKED - We need a second user here to finish this test
43
+ cy . mailchimpLogin ( 'test_user_no_list@mailchimp.com' , 'password123' ) ; // TODO: CHANGE LOG IN HERE
44
+ cy . visit ( '/wp-admin/admin.php?page=mailchimp_sf_options' ) ;
45
+
46
+ // Verify no list is saved for the test user
47
+ cy . get ( '#mc_list_id' ) . should ( 'have.value' , '' ) ; // Assuming empty value indicates no list is saved
48
+
49
+ // Step 3: Verify the signup form is not displayed on the frontend
50
+ cy . visit ( '/' ) ; // Navigate to the frontend homepage
51
+ cy . get ( '#mc_signup' ) . should ( 'not.exist' ) ; // Ensure the form does not exist
52
+ } ) ;
53
+
32
54
// TODO: Default settings are populated as expected
55
+ it . skip ( 'The default settings populate as expected' , ( ) => {
56
+ // Test here...
57
+ } ) ;
33
58
34
59
it ( 'Admin can create a Signup form using the shortcode' , ( ) => {
35
60
const postTitle = 'Mailchimp signup form - shortcode' ;
@@ -324,13 +349,4 @@ describe('Admin can update plugin settings', () => {
324
349
// Step 7: Ensure the original settings persist
325
350
cy . get ( '#mc_header_content' ) . should ( 'have.value' , customHeader ) ;
326
351
} ) ;
327
-
328
- // TODO: BLOCKED - Need separate Mailchimp user to finish this test
329
- it . skip ( 'The signup form is not displayed on the front end unless a list is saved' , ( ) => {
330
- // TODO: Log the user out and verify no sign up form exists on the frontend
331
- // TODO: BLOCKED - Option 1 (preferred): Use a test user that has never saved a list to verify the list can
332
- // not be seen on the FE
333
- // Option 2: Delete the option that saves the list selection in the DB to test that a sign up form
334
- // will not display on the FE without being selected. Would require interacting with the BE.
335
- } ) ;
336
352
} ) ;
0 commit comments