Skip to content

Commit 8747d6f

Browse files
Finish data persistence test
1 parent 7b1277d commit 8747d6f

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
/* eslint-disable no-undef */
22
// This is failing all other tests that come after it by causing the tests to redirect to login
33
// This is causing some kind of error with the session data
4-
describe.skip('Settings data persistence', () => {
4+
describe('Settings data persistence', () => {
5+
before(() => {
6+
cy.setDoubleOptInOption(false);
7+
cy.setJavaScriptOption(true);
8+
cy.setSettingsOption('#mc_update_existing', false);
9+
});
10+
511
it('Settings and list selection remain persistent between logging out and logging back in with the same account', () => {
6-
cy.visit('/wp-admin/admin.php?page=mailchimp_sf_options');
12+
cy.visit('/wp-admin/admin.php?page=mailchimp_sf_options');
13+
14+
// Initial settings
15+
cy.get('#mc_double_optin').should('exist').and('not.be.checked');
16+
cy.get('#mc_use_javascript').should('exist').and('be.checked');
17+
cy.get('#mc_update_existing').should('exist').and('not.be.checked');
718

8-
// Logout
9-
cy.mailchimpLogout();
10-
cy.logout();
19+
// Logout
20+
cy.mailchimpLogout();
21+
cy.logout();
1122

12-
// Login
13-
cy.login();
14-
cy.mailchimpLogin();
23+
// Login
24+
cy.login();
25+
cy.mailchimpLogin();
1526

16-
// Assertions regarding settings here...
27+
// Settings are still the same as before
28+
cy.get('#mc_double_optin').should('exist').and('not.be.checked');
29+
cy.get('#mc_use_javascript').should('exist').and('be.checked');
30+
cy.get('#mc_update_existing').should('exist').and('not.be.checked');
1731
});
1832
});

0 commit comments

Comments
 (0)