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 6391e63 commit 1b0142f
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions cypress/e2e/NewPage/NewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,25 +649,24 @@ And('you delete the recently added tracked entity', () => {
});

And('you delete the recently added malaria entity', () => {
// get all url query params
cy.url().then((url) => {
const urlParams = new URLSearchParams(url);
urlParams.delete('stageId');
urlParams.delete('eventId');
// deselect the program stage from the context selector
cy.get('[data-test="stage-selector-container-clear-icon"]')
.click();

cy.visit(`/#/enrollment?${urlParams.toString()}`);
cy.get('[data-test="dhis2-uicore-button"]')
.contains('Yes, discard changes')
.click();

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')
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();
cy.get('[data-test="widget-profile-delete-modal"]').within(() => {
cy.contains('Yes, delete Malaria Entity')
.click();
});
});
});

Expand Down

0 comments on commit 1b0142f

Please sign in to comment.