Skip to content

Commit c609900

Browse files
committed
fix: cypress temp
1 parent dbe10fb commit c609900

14 files changed

Lines changed: 25 additions & 23 deletions

File tree

cypress/e2e/EnrollmentPage/EnrollmentPageNavigation/EnrollmentPageNavigation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ And('you see the registration form for the Inpatient morbidity program', () => {
2525

2626
And('you see the registration form for the Malaria case diagnosis', () => {
2727
cy.get('[data-test="registration-page-content"]')
28-
.contains('New Enrollment in program: Malaria case diagnosis, treatment and investigation')
28+
.contains('New enrollment in program: Malaria case diagnosis, treatment and investigation')
2929
.should('exist');
3030
cy.get('[data-test="registration-page-content"]')
3131
.contains('Saving a new enrollment in Malaria case diagnosis, treatment and investigation in Taninahun (Malen) CHP.')
@@ -34,7 +34,7 @@ And('you see the registration form for the Malaria case diagnosis', () => {
3434

3535
And('you see the registration form for the MNCH PNC program', () => {
3636
cy.get('[data-test="registration-page-content"]')
37-
.contains('New Enrollment in program: MNCH / PNC (Adult Woman)')
37+
.contains('New enrollment in program: MNCH / PNC (Adult Woman)')
3838
.should('exist');
3939
cy.get('[data-test="registration-page-content"]')
4040
.contains('Saving a new enrollment in MNCH / PNC (Adult Woman) in Taninahun (Malen) CHP.')

cypress/e2e/NewPage/NewPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ And('you are in Child programme reenrollment page', () => {
552552

553553
And('you see the form prefield with existing TEI attributes values', () => {
554554
cy.get('[data-test="registration-page-content"]').within(() => {
555-
cy.contains('New Enrollment in program: Child Programme').should('exist');
555+
cy.contains('New enrollment in program: Child Programme').should('exist');
556556
cy.contains('First name').should('exist');
557557
cy.get('input[type="text"]').eq(4).should('have.value', 'Anna');
558558
cy.contains('Last name').should('exist');

cypress/e2e/ScopeSelector/ScopeSelector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ And('you see the enrollment event Edit page but there is no org unit id in the u
284284

285285
And('you see the enrollment event New page but there is no stage id in the url', () => {
286286
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollmentEventNew?enrollmentId=Aemr3Q02aqV&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=eUTmQGull6H`);
287-
cy.contains('Choose a stage for a new event');
287+
cy.contains('Choose a program stage for a new event');
288288
});
289289

290290
And('you see the enrollment page without org unit in the url', () => {
@@ -303,7 +303,7 @@ And('you reset the enrollment selection', () => {
303303
});
304304

305305
And('you reset the stage selection', () => {
306-
cy.get('[data-test="stage-selector-container-clear-icon"]')
306+
cy.get('[data-test="program stage-selector-container-clear-icon"]')
307307
.click();
308308
});
309309

cypress/e2e/TopBarActions/TopBarActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When('the user clicks the arrow button to see the dropdown', () => {
1616

1717
Then('the user sees the warning popup', () => {
1818
cy.contains('Discard unsaved changes?');
19-
cy.contains('This event has unsaved changes. Leaving this page without saving will lose these changes. Are you sure you want to discard unsaved changes?');
19+
cy.contains('This form has unsaved changes. Leaving this page without saving will lose these changes. Are you sure you want to discard unsaved changes?');
2020
});
2121

2222
When(/^the user set the WHOMCH Diastolic blood pressure to (.*)/, score =>

cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollmentNote/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { When, Then } from '@badeball/cypress-cucumber-preprocessor';
33
const timeStamp = Math.round((new Date()).getTime() / 1000);
44

55
Then('the stages and events should be loaded', () => {
6-
cy.contains('Stages and Events').should('exist');
6+
cy.contains('Program stages and events').should('exist');
77
});
88

99
When(/^you fill in the note: (.*)$/, (note) => {

cypress/e2e/WidgetsForEnrollmentPages/WidgetProfile/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Then(/^the user sees the edit profile modal/, () =>
4646
cy.get('[data-test="modal-edit-profile"]').within(() => {
4747
cy.contains('Edit Person').should('exist');
4848
cy.contains(
49-
'Change information about this Person here. Information about this enrollment can be edited in the Enrollment widget.',
49+
'Change information about this Person here. Information about this enrollment can be edited in the enrollment widget.',
5050
).should('exist');
5151
cy.contains('Save changes').should('exist');
5252
cy.contains('Cancel without saving').should('exist');

i18n/en.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ msgstr ""
55
"Content-Type: text/plain; charset=utf-8\n"
66
"Content-Transfer-Encoding: 8bit\n"
77
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
8-
"POT-Creation-Date: 2026-09-08T12:45:04.953Z\n"
9-
"PO-Revision-Date: 2026-09-08T12:45:04.953Z\n"
8+
"POT-Creation-Date: 2026-09-09T08:08:19.569Z\n"
9+
"PO-Revision-Date: 2026-09-09T08:08:19.569Z\n"
1010

1111
msgid "The application could not be loaded."
1212
msgstr "The application could not be loaded."
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react';
2-
import { capitalizeFirstLetter } from 'capture-core-utils/string/capitalizeFirstLetter';
32
import { useTermLabel, type TermRequest } from '../metaData';
43

54
export const withCustomLabels =
@@ -8,8 +7,5 @@ export const withCustomLabels =
87
(props: any) => {
98
const { programId, stageId } = props;
109
const labels = useTermLabel(requests, { programId, stageId });
11-
const capitalized = Object.fromEntries(
12-
Object.entries(labels).map(([key, value]) => [key, capitalizeFirstLetter(value)]),
13-
);
14-
return <InnerComponent {...props} {...capitalized} />;
10+
return <InnerComponent {...props} {...labels} />;
1511
};

src/core_modules/capture-core/components/DataEntries/Enrollment/EnrollmentDataEntry.component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import i18n from '@dhis2/d2-i18n';
44
import moment from 'moment';
55
import { type OrgUnit } from '@dhis2/rules-engine-javascript';
66
import { convertDateObjectToDateFormatString } from 'capture-core/utils/converters/date';
7+
import { capitalizeFirstLetter } from 'capture-core-utils/string/capitalizeFirstLetter';
78
import { isLangRtl } from '../../../utils/rtl';
89
import {
910
DataEntry,
@@ -376,7 +377,7 @@ class FinalEnrollmentDataEntry extends React.Component<FinalTeiDataEntryProps> {
376377
const dataEntrySections = {
377378
[sectionKeysForEnrollmentDataEntry.ENROLLMENT]: {
378379
placement: placements.TOP,
379-
name: enrollmentLabel,
380+
name: capitalizeFirstLetter(enrollmentLabel),
380381
},
381382
[AOCsectionKey]: {
382383
placement: placements.BOTTOM,

src/core_modules/capture-core/components/DataEntries/Enrollment/EnrollmentWithFirstStageDataEntry/hooks/useDataEntrySections.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useMemo } from 'react';
22
import i18n from '@dhis2/d2-i18n';
3+
import { capitalizeFirstLetter } from 'capture-core-utils/string/capitalizeFirstLetter';
34
import { placements } from '../../../../DataEntry/constants/placements.const';
45
import { sectionKeysForFirstStageDataEntry } from '../EnrollmentWithFirstStageDataEntry.constants';
56
import { AOCsectionKey } from '../../../../DataEntryDhis2Helpers';
@@ -11,7 +12,7 @@ export const useDataEntrySections = (stageName: string, beforeSectionId: string)
1112
() => ({
1213
[sectionKeysForFirstStageDataEntry.ENROLLMENT]: {
1314
placement: placements.TOP,
14-
name: enrollmentLabel,
15+
name: capitalizeFirstLetter(enrollmentLabel),
1516
},
1617
[sectionKeysForFirstStageDataEntry.STAGE_BASIC_INFO]: {
1718
beforeSectionId,

0 commit comments

Comments
 (0)