Skip to content

Commit

Permalink
feat: cy test for disabled button
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Aug 27, 2024
1 parent 462e678 commit 48a08b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ Scenario: User can see disabled scheduled date for active event
Then the user see the schedule date field with tooltip: Scheduled date cannot be changed for Active events

@user:trackerAutoTestRestricted
Scenario: The user can not enter edit mode for completed events
Scenario: The user cannot enter edit mode for completed events
Given you land on the enrollment event page with selected Person by having typed /#/enrollmentEventEdit?eventId=nUVwTLuQ6FT&orgUnitId=DiszpKrYNg8
And the user see the following text: Enrollment: View Event
Then the edit button should be disabled
When the user hovers over the disabled edit button
Then the user should see the tooltip: The event cannot be edited after it has been completed


Scenario: User can edit the event and complete the enrollment
Given you land on the enrollment event page with selected Malaria Entity by having typed #/enrollmentEventEdit?eventId=MHR4Zj6KLz0&orgUnitId=DiszpKrYNg8
And the enrollment status is active
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,3 @@ Then('the edit button should be disabled', () => {
.eq(1)
.should('be.disabled');
});

When('the user hovers over the disabled edit button', () => {
cy.get('[data-test="widget-enrollment-event"]')
.find('[data-test="dhis2-uicore-button"]')
.eq(1)
.parent()
.trigger('mouseover');
});

Then(/^the user should see the tooltip: (.*)$/, (tooltipContent) => {
cy.get('[data-test="dhis2-uicore-tooltip-content"]')
.should('be.visible')
.and('contain', tooltipContent);
});

0 comments on commit 48a08b1

Please sign in to comment.