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-6750] - VPC Delete tests #9920

Merged
merged 6 commits into from
Nov 21, 2023

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented Nov 20, 2023

Description 📝

  • Add unit tests for VPC Delete component
  • Add additional integration test to confirm error handling for VPC deletion
  • Small bug fix for VPC delete error state (make sure error doesn't persist when opening up the delete dialog)

Preview 📷

Bug fix:

Before After
Screen.Recording.2023-11-20.at.11.22.20.AM.mov
bugfixed.mov

How to test 🧪

Prerequisites

For testing the bug
(How to setup test environment)

  • With VPC account tags, set up two vpcs:
    • one VPC with at least one linode assigned to it
    • some other VPC
  • Navigate to VPC landing page

Reproduction steps

(How to reproduce the issue, if applicable)

  • Try to delete the VPC with a linode assigned to it (you shouldn't be able to, and you should see an error message pop up)
  • Close the VPC delete dialog and open dialog up for other VPC - the error message still persists

Verification steps

(How to verify changes)

  • Confirm error message no longer persists for VPC delete dialog
  • yarn test VPCDeleteDialog
  • yarn cy:run -s "cypress/e2e/core/vpc/vpc-landing-page.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

@coliu-akamai coliu-akamai added the VPC Relating to VPC project label Nov 20, 2023
@coliu-akamai coliu-akamai self-assigned this Nov 20, 2023
Comment on lines +25 to +29
React.useEffect(() => {
if (open) {
reset();
}
}, [open, reset]);
Copy link
Contributor Author

@coliu-akamai coliu-akamai Nov 20, 2023

Choose a reason for hiding this comment

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

On the VPC details page we disable subnet's delete action if the subnet still has linodes assigned to it -- the persistent error state is likely less of an issue here than the VPC delete dialog. Still added the fix to this dialog just in case some other error does appear bc we wouldn't want that to show up for some other subnet's delete dialog

@coliu-akamai coliu-akamai marked this pull request as ready for review November 20, 2023 16:48
@coliu-akamai coliu-akamai requested a review from a team as a code owner November 20, 2023 16:48
@coliu-akamai coliu-akamai requested review from dwiley-akamai, tyler-akamai, jdamore-linode and hana-akamai and removed request for a team November 20, 2023 16:48
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.

Error message no longer persists for VPC delete dialog ✅
Unit test passes ✅
E2E test passes ✅

@coliu-akamai coliu-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels Nov 21, 2023
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.

Looks great! Thanks @coliu-akamai

cy.wait(['@deleteVPCError']);
cy.findByText(MOCK_DELETE_VPC_ERROR).should('be.visible');

// close Delete dialog for this VPC and open it up for the second VPC to confirm that error message does not persist
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice extra detail to cover, good thinking!

@coliu-akamai coliu-akamai merged commit a545a0d into linode:develop Nov 21, 2023
11 checks passed
@coliu-akamai coliu-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Nov 21, 2023
@coliu-akamai coliu-akamai deleted the test-m3-6750 branch November 21, 2023 21:46
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! VPC Relating to VPC project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants