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-7483] - Add test to delete users on "Users & Grants" page #10093

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

cliu-akamai
Copy link
Contributor

Description 📝

Add regression tests for deleting users on Users & Grants page.

Major Changes 🔄

  • Add regression tests to delete users on Users & Grants page.

How to test 🧪

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

@cliu-akamai cliu-akamai requested a review from a team as a code owner January 22, 2024 18:45
@cliu-akamai cliu-akamai requested review from jdamore-linode, mjac0bs and bnussman-akamai and removed request for a team January 22, 2024 18:45
Copy link

github-actions bot commented Jan 22, 2024

Coverage Report:
Base Coverage: 80.18%
Current Coverage: 80.18%

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 @cliu-akamai!

cy.wait(['@deleteUser', '@getUsers']);

// the user is deleted
cy.findByText(additionalUser.username).should('not.exist');
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
cy.findByText(additionalUser.username).should('not.exist');
ui.toast.assertMessage(`User ${additionalUser.username} has been deleted successfully.`);
cy.findByText(additionalUser.username).should('not.exist');

This wasn't a ticket requirement, but it would be good to have the toast notification covered too!

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed!

cy.findByText(mockUser.username).should('be.visible');
cy.findByText(additionalUser.username).should('be.visible');

// clickl the "x" button will dismiss the dialog and do nothing
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
// clickl the "x" button will dismiss the dialog and do nothing
// clicking the "x" button will dismiss the dialog and do nothing

@jdamore-linode jdamore-linode changed the title M3-7483 Add test to delete users on "Users & Grants" page test: [M3-7483] - Add test to delete users on "Users & Grants" page Jan 22, 2024
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.

Can we add a Test changeset with yarn changeset please?

Other than the couple of typos to fix and Joe's additional suggestion of confirming the toast, this passes as expected and covers the expected behavior - thank you!

image

ui.dialog.findByTitle('Confirm Deletion').within(() => {
ui.button.findByTitle('Cancel').should('be.visible').click();
});
// click the "Cancel" button will do nothing
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
// click the "Cancel" button will do nothing
// clicking the "Cancel" button will dismiss the dialog and do nothing

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this small adjustment; it'll make it align with the comment for the next assertion too.

cy.wait(['@deleteUser', '@getUsers']);

// the user is deleted
cy.findByText(additionalUser.username).should('not.exist');
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed!

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Jan 22, 2024
@cliu-akamai cliu-akamai requested a review from a team as a code owner January 23, 2024 17:44
@cliu-akamai cliu-akamai requested review from dwiley-akamai and jaalah-akamai and removed request for a team January 23, 2024 17:44
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.

Test passes ✅
Code review ✅

ui.dialog.findByTitle('Confirm Deletion').within(() => {
ui.button.findByTitle('Cancel').should('be.visible').click();
});
// click the "Cancel" button will do nothing
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this small adjustment; it'll make it align with the comment for the next assertion too.

@cliu-akamai cliu-akamai merged commit cb5726d into linode:develop Jan 25, 2024
17 of 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

4 participants