diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js index 9a1ac6dace..9f45c31e2f 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetAssignee/index.js @@ -2,8 +2,7 @@ import { When, Then } from '@badeball/cypress-cucumber-preprocessor'; When('you assign the user Geetha in the view mode', () => { cy.get('[data-test="widget-assignee"]').within(() => { - cy.get('[data-test="widget-assignee-edit"]').click(); - cy.get('[data-test="dhis2-uicore-chip-remove"]').click(); + cy.get('[data-test="widget-assignee-assign"]').click(); cy.get('[data-test="capture-ui-input"]').type('Geetha'); cy.contains('Geetha Alwan').click(); cy.get('[data-test="widget-assignee-save"]').click(); @@ -26,6 +25,14 @@ When('you assign the user Tracker demo User in the edit mode', () => { }); }); +When('you remove the assigned user', () => { + cy.get('[data-test="widget-assignee"]').within(() => { + cy.get('[data-test="widget-assignee-edit"]').click(); + cy.get('[data-test="dhis2-uicore-chip-remove"]').click(); + cy.get('[data-test="widget-assignee-save"]').click(); + }); +}); + Then('the event has the user Geetha Alwan assigned', () => { cy.get('[data-test="widget-assignee"]').within(() => { cy.get('[data-test="widget-contents"]').contains('Geetha Alwan').should('exist'); @@ -37,3 +44,9 @@ Then('the event has the user Tracker demo User assigned', () => { cy.get('[data-test="widget-contents"]').contains('Tracker demo User').should('exist'); }); }); + +Then('the event has no assignd user', () => { + cy.get('[data-test="widget-assignee"]').within(() => { + cy.get('[data-test="widget-contents"]').contains('No one is assigned to this event').should('exist'); + }); +}); diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent.feature index c333e2b547..27dae1fd6a 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent.feature @@ -105,8 +105,10 @@ Feature: The user interacts with the widgets on the enrollment edit event Then list should contain the new comment: new test comment Scenario: You can assign a user to a event - Given you land on the enrollment edit event page by having typed /#/enrollmentEventEdit?eventId=SObENdEf76z&orgUnitId=g8upMTyEZGZ + Given you land on the enrollment edit event page by having typed /#/enrollmentEventEdit?eventId=veuwiLC2x0e&orgUnitId=g8upMTyEZGZ When you assign the user Geetha in the view mode Then the event has the user Geetha Alwan assigned When you assign the user Tracker demo User in the edit mode Then the event has the user Tracker demo User assigned + When you remove the assigned user + Then the event has no assignd user