Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: [M3-6169] - Account cancellation integration tests #9952

Conversation

jdamore-linode
Copy link
Contributor

Description 📝

This adds Cypress integration tests for various UI flows related to account cancellation via Cloud Manager's Account Settings page. Broadly speaking, these tests confirm that users can cancel their account, are correctly prompted to complete an exit survey, and that Cloud responds gracefully to API errors that occur during the cancellation process.

Changes 🔄

  • Adds account cancellation test for unrestricted users
  • Adds account cancellation test for restricted users
    • ℹ️ Currently Cloud doesn't handle this any differently from any other API error that could occur when cancelling an account, but if we were to enhance this UX we'll now have a test case to cover it

How to test 🧪

We can rely on CI to make sure that the tests pass and that changes made to mock utils and UI helpers do not cause any unintended issues.

To run the test locally, you can runyarn && yarn build && yarn start:manager:ci and then run:

yarn cy:run -s "cypress/e2e/core/account/account-cancellation.spec.ts"

Alternatively, to run the tests interactively you can use yarn cy:debug and search for account-cancellation.spec.ts.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

Comment on lines +126 to +130
cy.wait('@cancelAccount').then((intercept) => {
expect(intercept.request.body['comments']).to.equal(
cancellationComments
);
});
Copy link
Contributor Author

@jdamore-linode jdamore-linode Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cliu-akamai, calling this out since you'll probably have to do something similar to confirm the Add User request payload contains the expected data for your M3-7482 ticket.

@jdamore-linode jdamore-linode requested a review from a team as a code owner December 1, 2023 19:10
@jdamore-linode jdamore-linode requested review from dwiley-akamai and cpathipa and removed request for a team December 1, 2023 19:10
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ✅
account-cancellation.spec.ts passes locally ✅

export const mockCancelAccountError = (
errorMessage: string,
status: number = 400
) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a Cypress.Chainable return type be added for this one as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dwiley-akamai Yep, thanks for catching that!

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
image

Copy link

github-actions bot commented Dec 4, 2023

Coverage Report:
Base Coverage: 85.37%
Current Coverage: 85.39%

@jdamore-linode jdamore-linode merged commit 2bf58dd into linode:develop Dec 4, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants