Skip to content

Commit

Permalink
fix: change test
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen committed Jan 16, 2025
1 parent de64f39 commit 6391e63
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions cypress/e2e/NewPage/NewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,16 +649,25 @@ And('you delete the recently added tracked entity', () => {
});

And('you delete the recently added malaria entity', () => {
cy.get('[data-test="profile-widget"]')
.contains('Malaria Entity profile')
.should('exist');
cy.get('[data-test="widget-profile-overflow-menu"]')
.click();
cy.contains('Delete Malaria Entity')
.click();
cy.get('[data-test="widget-profile-delete-modal"]').within(() => {
cy.contains('Yes, delete Malaria Entity')
// get all url query params
cy.url().then((url) => {
const urlParams = new URLSearchParams(url);
urlParams.delete('stageId');
urlParams.delete('eventId');

cy.visit(`/#/enrollment?${urlParams.toString()}`);

cy.get('[data-test="profile-widget"]')
.contains('Malaria Entity profile')
.should('exist');
cy.get('[data-test="widget-profile-overflow-menu"]')
.click();
cy.contains('Delete Malaria Entity')
.click();
cy.get('[data-test="widget-profile-delete-modal"]').within(() => {
cy.contains('Yes, delete Malaria Entity')
.click();
});
});
});

Expand Down

0 comments on commit 6391e63

Please sign in to comment.