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-7517 & M3-7519] - Cypress integration tests for Child -> Parent and Child -> Child account switching #10288

Conversation

jdamore-linode
Copy link
Contributor

Description πŸ“

Adds a couple Cypress tests to test the account switching for Parent -> Child and Child -> Child flows. Additionally makes some fixes and improvements to the existing tests (especially mocks) to resolve some inaccuracies.

I opted to only test these flows from the billing page to cut back on tests required (essentially for the sake of our Cypress Cloud usage) -- my thought is we already have the existing test to cover using the user menu to initiate the flow, but I'm happy to budge on this if there are any thoughts, objections, etc.

Changes πŸ”„

List any change relevant to the reviewer.

  • Adds Child -> Parent account switching test
  • Adds Child -> Child account switching test
  • Fixes various shortcomings with our existing Parent -> Child account switching tests

Target release date πŸ—“οΈ

N/A

How to test πŸ§ͺ

I recommend reviewing these tests using Cypress's debugger (via yarn cy:debug) so you can see them in action and observe any details, etc. that might stand out.

Alternatively, you can run the test from the command line:

yarn && yarn build && yarn start:manager:ci, then:

yarn cy:run -s "cypress/e2e/core/parentChild/account-switching.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

mockAlternateChildAccountToken.expiry!,
mockAlternateChildAccountToken.scopes
);
// TODO Confirm whether toast is intended here.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wanted to call this out: do we expect a toast notification to appear when switching from a Child account to another Child account? Seems like proxy_user doesn't get reset in local storage

Copy link
Contributor

Choose a reason for hiding this comment

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

@jdamore-linode Yea that's a good callout. I'll track this in a new ticket!

@jdamore-linode jdamore-linode requested a review from a team as a code owner March 14, 2024 21:15
@jdamore-linode jdamore-linode requested review from dwiley-akamai and hana-linode and removed request for a team March 14, 2024 21:15
Copy link

github-actions bot commented Mar 14, 2024

Coverage Report: βœ…
Base Coverage: 81.45%
Current Coverage: 81.45%

@jaalah-akamai jaalah-akamai added the Approved Multiple approvals and ready to merge! label Mar 19, 2024
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.

The flow looked good to me 🚒

Screenshot 2024-03-19 at 12 45 12β€―PM

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Read through this spec and I think this is well covered, thank you, Joe!

@jdamore-linode jdamore-linode merged commit 6223170 into linode:develop Mar 21, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Parent / Child Account
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants