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', () => {
7
7
it ( 'Admin can logout' , ( ) => {
8
8
cy . visit ( '/wp-admin/admin.php?page=mailchimp_sf_options' ) ;
9
9
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
+
10
16
cy . get ( 'input[value="Logout"]' ) . click ( ) ;
11
17
12
18
// connect to "Mailchimp" Account button should be visible.
Original file line number Diff line number Diff line change 21
21
<td><h3><?php esc_html_e ( 'Logged in as ' , 'mailchimp ' ); ?> : <?php echo esc_html ( $ user ['username ' ] ); ?> </h3>
22
22
</td>
23
23
<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 ' ) ); ?> ');" >
25
25
<input type="hidden" name="mcsf_action" value="logout"/>
26
26
<input type="submit" name="Submit" value="<?php esc_attr_e ( 'Logout ' , 'mailchimp ' ); ?> " class="button button-secondary mailchimp-sf-button small" />
27
27
<?php wp_nonce_field ( 'mc_logout ' , '_mcsf_nonce_action ' ); ?>
You can’t perform that action at this time.
0 commit comments