Skip to content

Commit

Permalink
Merge branch 'master' into DHIS2-13237
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Sep 7, 2023
2 parents af48be5 + 4ef2973 commit ffa39ae
Show file tree
Hide file tree
Showing 105 changed files with 1,736 additions and 2,761 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# [100.38.0](https://github.com/dhis2/capture-app/compare/v100.37.0...v100.38.0) (2023-09-06)


### Features

* [DHIS2-14334] edit enrollment date ([#3350](https://github.com/dhis2/capture-app/issues/3350)) ([9dd1b6a](https://github.com/dhis2/capture-app/commit/9dd1b6a046e94021ae4e63a67a3d6b16a099212d))

# [100.37.0](https://github.com/dhis2/capture-app/compare/v100.36.0...v100.37.0) (2023-08-22)


### Features

* [DHIS2-15299] escape value for attribute filter ([#3403](https://github.com/dhis2/capture-app/issues/3403)) ([5db743e](https://github.com/dhis2/capture-app/commit/5db743eaf7f67bbb4a9391ac9ade25317e4d3642))

# [100.36.0](https://github.com/dhis2/capture-app/compare/v100.35.9...v100.36.0) (2023-08-22)


### Features

* [DHIS2-15229] search for MULTI_TEXT ([#3395](https://github.com/dhis2/capture-app/issues/3395)) ([c5d9a7d](https://github.com/dhis2/capture-app/commit/c5d9a7d57547153dd62cf36c8e3323685f43978f))

## [100.35.9](https://github.com/dhis2/capture-app/compare/v100.35.8...v100.35.9) (2023-08-22)


### Bug Fixes

* [DHIS2-15700] Option sets not working in TEI Registration ([2e47477](https://github.com/dhis2/capture-app/commit/2e4747719151b042d3539fe61a612ebd0ac122d4))

## [100.35.8](https://github.com/dhis2/capture-app/compare/v100.35.7...v100.35.8) (2023-08-22)


### Bug Fixes

* [DHIS2-15492] transition of tooltip enabled state ([#3381](https://github.com/dhis2/capture-app/issues/3381)) ([adb6b32](https://github.com/dhis2/capture-app/commit/adb6b32f1bffc5020ca34ab5c7568b5a323a8002))

## [100.35.7](https://github.com/dhis2/capture-app/compare/v100.35.6...v100.35.7) (2023-08-15)


### Bug Fixes

* [DHIS2-15525] show formNames in the enrollment dashboard ([#3402](https://github.com/dhis2/capture-app/issues/3402)) ([c02c3ee](https://github.com/dhis2/capture-app/commit/c02c3ee46ed4209215946636682ec86c97c9d905))

## [100.35.6](https://github.com/dhis2/capture-app/compare/v100.35.5...v100.35.6) (2023-08-11)


### Bug Fixes

* [TECH-1623] rename TEI "Launchpad McQuack" -> "Breaking TheGlass" ([#3400](https://github.com/dhis2/capture-app/issues/3400)) ([7f26237](https://github.com/dhis2/capture-app/commit/7f262372499b98d9fd8071c7b8069238ad3a1d15))

## [100.35.5](https://github.com/dhis2/capture-app/compare/v100.35.4...v100.35.5) (2023-08-03)


Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/EnrollmentPage/BreakingTheGlass/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../sharedSteps';

Given('the tei created by this test is cleared from the database', () => {
cy.buildApiUrl('tracker', 'trackedEntities?filter=w75KJ2mc4zz:like:Launchpad&filter=zDhUuAYrxNC:like:McQuack&trackedEntityType=nEenWmSyUEp&page=1&pageSize=5&ouMode=ACCESSIBLE')
cy.buildApiUrl('tracker', 'trackedEntities?filter=w75KJ2mc4zz:like:Breaking&filter=zDhUuAYrxNC:like:TheGlass&trackedEntityType=nEenWmSyUEp&page=1&pageSize=5&ouMode=ACCESSIBLE')
.then(url => cy.request(url))
.then(({ body }) =>
body.instances.forEach(({ trackedEntity }) =>
Expand All @@ -24,12 +24,12 @@ And('you create a new tei in Child programme from Ngelehun CHC', () => {
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(0)
.type('Launchpad')
.type('Breaking')
.blur();
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(1)
.type('McQuack')
.type('TheGlass')
.blur();

clickSave();
Expand Down Expand Up @@ -61,7 +61,7 @@ And('you enroll the tei from Njandama MCHP', () => {
.click();

cy.get('[data-test="enrollment-page-content"]')
.contains('Enroll Launchpad McQuack in this program')
.contains('Enroll Breaking TheGlass in this program')
.click();

cy.get('[data-test="d2-form-component"]')
Expand Down Expand Up @@ -97,7 +97,7 @@ And('you log in as tracker2 user', () => {

And('you select the new tei', () => {
cy.visit('/#/?orgUnitId=DiszpKrYNg8&programId=IpHINAT79UW');
cy.contains('Launchpad')
cy.contains('Breaking')
.click();
// Wait for enrollment dashboard
cy.get('[data-test="profile-widget"]')
Expand Down
7 changes: 7 additions & 0 deletions cypress/integration/EnrollmentPage/HiddenProgramStage.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Hidden program stage

Scenario: The user cannot add an event in a hidden program stage
Given you add an enrollment event that will result in a rule effect to hide a program stage
Then the New Postpartum care visit event button is disabled in the stages and events widget
And and an error is show in the Postpartum care visit stage
And the Postpartum care visit button is disabled in the enrollmentEventNew page
66 changes: 66 additions & 0 deletions cypress/integration/EnrollmentPage/HiddenProgramStage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import moment from 'moment';

const cleanUpIfApplicable = () => {
cy.buildApiUrl(
'tracker',
'trackedEntities/uW8Y7AIcRKA?program=WSGAb5XwJ3Y&fields=enrollments',
)
.then(url => cy.request(url))
.then(({ body }) => {
const enrollment = body.enrollments?.find(e => e.enrollment === 'fmhIsWXVDmS');
const event = enrollment?.events?.find(e => e.programStage === 'PFDfvmGpsR3');
if (!event) {
return null;
}
return cy
.buildApiUrl('events', event.event)
.then(eventUrl =>
cy.request('DELETE', eventUrl));
});
};

Given('you add an enrollment event that will result in a rule effect to hide a program stage', () => {
cleanUpIfApplicable();
cy.visit(
'/#/enrollmentEventNew?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&stageId=PFDfvmGpsR3&teiId=uW8Y7AIcRKA',
);

cy.get('[data-test="capture-ui-input"]')
.eq(0)
.type(moment().format('YYYY-MM-DD'))
.blur();

cy
.get('[data-test="virtualized-select"]')
.eq(6)
.click()
.contains('Termination of pregnancy')
.click();

cy.contains('[data-test="dhis2-uicore-button"]', 'Save without completing').click();
});

Then('the New Postpartum care visit event button is disabled in the stages and events widget', () => {
cy.contains('[data-test="create-new-button"]', 'New Postpartum care visit event')
.should('be.disabled');
});

Then('and an error is show in the Postpartum care visit stage', () => {
cy.visit(
'/#/enrollmentEventNew?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&teiId=uW8Y7AIcRKA&stageId=bbKtnxRZKEP',
);
cy.contains('[data-test="dhis2-uicore-button"]', 'Complete')
.should('be.disabled');
cy.contains('[data-test="dhis2-uicore-button"]', 'Save without completing')
.should('be.disabled');
cy.contains('[data-test="dhis2-uicore-noticebox-content"]', 'You can\'t add any more Postpartum care visit events')
.should('exist');
});

Then('the Postpartum care visit button is disabled in the enrollmentEventNew page', () => {
cy.visit(
'/#/enrollmentEventNew?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&teiId=uW8Y7AIcRKA',
);

cy.contains('[data-test="program-stage-selector-button"]', 'Postpartum care visit').should('be.disabled');
});
8 changes: 0 additions & 8 deletions cypress/integration/SearchPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ Feature: User interacts with Search page
# And you click search
# Then you should see no results found

Scenario: Searching using attributes in Tracker Program throws error
Given you are on the default search page
When you select the search domain Malaria Case diagnosis
And you expand the attributes search area
And you fill in the first name with values that will return an error
And you click search
Then there should be an generic error message

Scenario: Searching using attributes in Tracker Program is invalid because no terms typed
Given you are on the default search page
When you select the search domain Malaria Case diagnosis
Expand Down
13 changes: 0 additions & 13 deletions cypress/integration/SearchPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,6 @@ When('for Person you fill in values that will return less than 5 results', () =>
.blur();
});

When('you fill in the first name with values that will return an error', () => {
cy.get('[data-test="form-attributes"]')
.find('[data-test="capture-ui-input"]')
.first()
.type(',,,,')
.blur();
});

Then('there should be an generic error message', () => {
cy.get('[data-test="general-purpose-error-mesage"]')
.should('exist');
});

When('you dont fill in any of the values', () => {
cy.get('[data-test="form-attributes"]')
.find('[data-test="capture-ui-input"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ Then('the enrollment widget should be opened', () => {
});

Then('the user sees the enrollment date', () => {
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-enrollment-date"]').within(() => {
cy.get('[data-test="widget-enrollment-icon-calendar"]').should('exist');
cy.get('[data-test="widget-enrollment-enrollment-date"]')
.contains(`Date of enrollment ${getCurrentYear()}-08-01`)
cy.get('[data-test="widget-enrollment-date"]')
.contains(`Date of enrollment: ${getCurrentYear()}-08-01`)
.should('exist');
});
});

Then('the user sees the incident date', () => {
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-incident-date"]')
.contains(`Date of birth ${getCurrentYear()}-08-01`)
cy.get('[data-test="widget-enrollment-incident-date"]').within(() => {
cy.get('[data-test="widget-enrollment-date"]')
.contains(`Date of birth: ${getCurrentYear()}-08-01`)
.should('exist');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Then('the list should display the events retrieved from the api', () => {
cy.get('[data-test="event-working-lists"]')
.find('tr')
.each(($teiRow, index) => {
const rowId = $teiRow.get(0).getAttribute('id');
const rowId = $teiRow.get(0).getAttribute('data-test');
if (index > 1) {
expect(rowId).to.equal(teis[index - 1].event);
}
Expand Down Expand Up @@ -232,25 +232,27 @@ When('you click the report date column header', () => {

cy.route('GET', '**/tracker/events**').as('getEvents');

cy.get('[data-test="online-list-table"]')
.contains('Report date')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click()
.click();
});

Then('events should be retrieved from the api ordered ascendingly by report date', () => {
cy.wait('@getEvents', { timeout: 40000 }).as('result');
cy.wait('@getEvents', { timeout: 40000 }).as('resultDefault');
cy.wait('@getEvents', { timeout: 40000 }).as('resultAsc');

cy.get('@result')
cy.get('@resultAsc')
.its('status')
.should('equal', 200);

cy.get('@result')
cy.get('@resultAsc')
.its('url')
.should('match', /order=.*asc/);

cy.get('@result')
cy.get('@resultAsc')
.its('url')
.should('include', 'page=1');

cy.get('@result').its('response.body.instances').as('events');
cy.get('@resultAsc').its('response.body.instances').as('events');
});
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ Then('the list should display 10 rows of data', () => {
});

When('you click the report date column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('Report date')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click()
.click();
});

Expand Down Expand Up @@ -364,8 +365,9 @@ When('you change the sharing settings', () => {


When('you update the working list', () => {
cy.get('[data-test="online-list-table"]')
.contains('Report date')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click()
.click();

cy.get('[data-test="list-view-menu-button"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Then('the list should display the teis retrieved from the api', () => {
cy.get('[data-test="tei-working-lists"]')
.find('tr')
.each(($teiRow, index) => {
const rowId = $teiRow.get(0).getAttribute('id');
const rowId = $teiRow.get(0).getAttribute('data-test');
if (index > 1) {
expect(rowId).to.equal(teis[index - 1].trackedEntity);
}
Expand Down Expand Up @@ -226,8 +226,8 @@ When('you click the first name column header', () => {

cy.route('GET', '**/tracker/trackedEntities**').as('getTeis');

cy.get('[data-test="online-list-table"]')
.contains('First name')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,21 @@ Then('the list should display 10 rows of data', () => {
});

When('you click the first name column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('First name')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click();
});

When('you click the last name column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('Last name')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(2)
.click();
});

When('you click the WHOMCH Smoking column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('WHOMCH Smoking')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(6)
.click()
.click();
});

Expand Down
10 changes: 6 additions & 4 deletions cypress/integration/WorkingLists/sharedSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ Then('the pagination for the tei working list should show the second page', () =
});

Then('the sort arrow should indicate ascending order', () => {
cy.get('[data-test="data-table-asc-sort-icon"]')
.should('exist');
cy.get('[data-test="table-row"]').within(() => {
cy.get('[data-test="table-row-asc"]').should('exist');
});
});

Then('the enrollment status filter button should show that the active filter is in effect', () => {
Expand Down Expand Up @@ -133,8 +134,9 @@ When('you click the first page button', () => {
});

Then('the sort arrow should indicate descending order', () => {
cy.get('[data-test="data-table-desc-sort-icon"]')
.should('exist');
cy.get('[data-test="table-row"]').within(() => {
cy.get('[data-test="table-row-desc"]').should('exist');
});
});

Then('rows per page should be set to 15', () => {
Expand Down
Loading

0 comments on commit ffa39ae

Please sign in to comment.