Skip to content

Commit d55ff58

Browse files
(Admin) Jonathan Ruda(Admin) Jonathan Ruda
authored andcommitted
Mixed up tests
1 parent 4009eff commit d55ff58

1 file changed

Lines changed: 10 additions & 24 deletions

File tree

cypress/tests/mocked/parallel-2/cancelTierThree.cy.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { toMembersDataApiResponse } from '../../../../client/fixtures/mdapiResponse';
21
import { tierThree } from '../../../../client/fixtures/productBuilder/testProducts';
2+
import { toMembersDataApiResponse } from '../../../../client/fixtures/mdapiResponse';
33
import { signInAndAcceptCookies } from '../../../lib/signInAndAcceptCookies';
44

55
describe('Cancel tier three', () => {
@@ -86,9 +86,6 @@ describe('Cancel tier three', () => {
8686
});
8787

8888
it('cancels tier three (reason: I dont have time to use my subscription, effective: next billing date)', () => {
89-
const feedback =
90-
'I still value the journalism, but this no longer fits my budget right now.';
91-
9289
cy.visit('/');
9390

9491
cy.findByText('Manage subscription').click();
@@ -98,38 +95,27 @@ describe('Cancel tier three', () => {
9895
name: 'Cancel subscription',
9996
}).click();
10097

101-
cy.findByText("We're sorry to see you go").should('exist');
102-
cy.contains('multiple/multiple').should('not.exist');
103-
cy.contains('multiple account plan').should('exist');
98+
cy.findByText(
99+
'We’re sorry to hear you’re thinking of cancelling your digital + print subscription',
100+
).should('exist');
104101

105102
cy.findAllByRole('radio').eq(6).click();
106-
cy.findByRole('textbox').type(feedback);
107103

108-
cy.findByRole('button', { name: 'Continue to Cancel' }).click();
104+
cy.findAllByRole('radio').check('Today');
105+
cy.findByRole('button', { name: 'Continue' }).click();
109106

110107
cy.wait('@get_case');
111108

112-
cy.findByText('Pause your subscription').should('exist');
113-
cy.findByRole('button', { name: 'Previous' }).click();
114-
cy.findAllByRole('radio').eq(6).should('be.checked');
115-
cy.findByRole('textbox').should('have.value', feedback);
116-
cy.findByRole('button', { name: 'Continue to Cancel' }).click();
117-
118-
cy.findByRole('button', { name: 'Continue to cancel' }).click();
109+
cy.findByRole('button', { name: 'Confirm cancellation' }).click();
119110

120111
cy.wait('@cancel_gw_holidays');
121112
cy.wait('@cancel_gw_deliveryrecords');
113+
cy.wait('@create_case_in_salesforce');
122114

123115
cy.findByText(
124-
'test, thank you for supporting the Guardian since 29 November 2021. Is this really goodbye?',
116+
'Your cancellation request has been successfully submitted. Our customer service team will try their best to contact you as soon as possible to confirm the cancellation and refund any credit you are owed.',
125117
).should('exist');
126-
cy.findByRole('button', { name: 'Confirm cancellation' }).click();
127118

128-
cy.findByText(
129-
'Your subscription to Digital + Print has been cancelled.',
130-
).should('exist');
131-
cy.findByText(
132-
'Your cancellation will take effect on 25 Jul 2024.',
133-
).should('exist');
119+
cy.get('@get_cancellation_date.all').should('have.length', 1);
134120
});
135121
});

0 commit comments

Comments
 (0)