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-8105] - Clean up cy.intercept calls in resize-linode #10476

Conversation

AzureLatte
Copy link
Contributor

@AzureLatte AzureLatte commented May 16, 2024

Description πŸ“

Clean up cy.intercept calls in resize-linode

Changes πŸ”„

List any change relevant to the reviewer.

  • Replace calls to cy.intercept with intercept utils in linodes.ts.
  • Adds interceptLinodeResize() util

How to test πŸ§ͺ

We can rely on CI to confirm that this test has not been broken by these changes, but to run the test locally you can use this command:

yarn cy:run -s "cypress/e2e/core/linodes/resize-linode.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

@AzureLatte AzureLatte requested review from a team May 16, 2024 13:43
@AzureLatte AzureLatte self-assigned this May 16, 2024
@AzureLatte AzureLatte requested review from jdamore-linode, hkhalil-akamai and cliu-akamai and removed request for a team May 16, 2024 13:43
Copy link

github-actions bot commented May 16, 2024

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

@AzureLatte AzureLatte requested review from a team as code owners May 16, 2024 14:20
@AzureLatte AzureLatte requested review from bnussman-akamai and jaalah-akamai and removed request for a team May 16, 2024 14:20
Copy link
Contributor

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

🧼

@jaalah-akamai jaalah-akamai added the Approved Multiple approvals and ready to merge! label May 16, 2024
Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Couple small things, but I think it raises a more interesting question: if the test seems to run just fine without the intercepts for the resize requests, would it be better to just get rid of them altogether? Any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seeing one call to cy.intercept() that slipped through the cracks!

ln 40

      cy.intercept(
        'POST',
        apiMatcher(`linode/instances/${linode.id}/resize`)
      ).as('linodeResize');

(GitHub wouldn't let me comment on those specific lines for some reason πŸ˜…)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update this one, thank you!

'POST',
apiMatcher(`linode/instances/${linode.id}/resize`)
).as('linodeResize');
mockGetFeatureFlagClientstream().as('linodeResize');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mockGetFeatureFlagClientstream().as('linodeResize');
interceptLinodeResize().as('linodeResize');

(This also applies to the replacements later in the file)

Interestingly the tests still run and pass just fine -- it calls into question whether the intercepts are even really necessary in these tests!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like there are some copy-paste errors :(
I'll correct them!

Copy link
Contributor

Choose a reason for hiding this comment

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

Haha we've all been there πŸ˜…

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Great work @AzureLatte!

@AzureLatte AzureLatte merged commit 7b89452 into linode:develop May 17, 2024
18 checks passed
@AzureLatte AzureLatte deleted the M3-8105-refactor-linode-resize-test-intercepts branch May 17, 2024 18:41
@AzureLatte AzureLatte added Clean Up and removed Approved Multiple approvals and ready to merge! Ready for Review labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants