File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ describe('Logout tests', () => {
77 it ( 'Admin can logout' , ( ) => {
88 cy . visit ( '/wp-admin/admin.php?page=mailchimp_sf_options' ) ;
99 cy . get ( '#mailchimp_sf_oauth_connect' ) . should ( 'not.exist' ) ;
10+
11+ cy . on ( 'window:confirm' , ( text ) => {
12+ expect ( text ) . to . contains ( 'Are you sure you want to log out?' ) ;
13+ return true ;
14+ } ) ;
15+
1016 cy . get ( 'input[value="Logout"]' ) . click ( ) ;
1117
1218 // connect to "Mailchimp" Account button should be visible.
Original file line number Diff line number Diff line change 2121 <td><h3><?php esc_html_e ( 'Logged in as ' , 'mailchimp ' ); ?> : <?php echo esc_html ( $ user ['username ' ] ); ?> </h3>
2222 </td>
2323 <td>
24- <form method="post" action="">
24+ <form method="post" action="" onsubmit="return confirm(' <?php echo esc_js ( __ ( ' Are you sure you want to log out? ' , ' mailchimp ' ) ); ?> ');" >
2525 <input type="hidden" name="mcsf_action" value="logout"/>
2626 <input type="submit" name="Submit" value="<?php esc_attr_e ( 'Logout ' , 'mailchimp ' ); ?> " class="button button-secondary mailchimp-sf-button small" />
2727 <?php wp_nonce_field ( 'mc_logout ' , '_mcsf_nonce_action ' ); ?>
You can’t perform that action at this time.
0 commit comments