Skip to content

Commit

Permalink
fixed multi select dropdown closing issue in cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Aug 22, 2024
1 parent 28d7bff commit 0c4d822
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 0 additions & 2 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
Expand All @@ -76,7 +75,6 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeOtherDetails(otherExamination);
patientLogupdate.selectSymptomsDate("01012024");
patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]);
patientLogupdate.clickAddSymptom();
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeSystolic(patientSystolic);
patientLogupdate.typeDiastolic(patientDiastolic);
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Cypress.Commands.add(
optionArray.forEach((options) => {
cy.get("[role='option']").contains(options).click();
});
cy.get(selector).click();
cy.get(selector).get("#dropdown-toggle").click({ force: true });
});
},
);
Expand All @@ -153,7 +153,7 @@ Cypress.Commands.add(
optionArray.forEach((options) => {
cy.get("[role='option']").contains(options).click();
});
cy.get(selector).click();
cy.get(selector).get("#dropdown-toggle").click({ force: true });
});
},
);
Expand Down
6 changes: 5 additions & 1 deletion src/Components/Form/AutoCompleteAsync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ const AutoCompleteAsync = (props: Props) => {
className="-mb-1.5 animate-spin"
/>
) : (
<CareIcon icon="l-angle-down" className="-mb-1.5" />
<CareIcon
id="dropdown-toggle"
icon="l-angle-down"
className="-mb-1.5"
/>
)}
</div>
</ComboboxButton>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Form/FormFields/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const Autocomplete = <T, V>(props: AutocompleteProps<T, V>) => {
{props.isLoading ? (
<CareIcon icon="l-spinner" className="animate-spin" />
) : (
<CareIcon icon="l-angle-down" />
<CareIcon id="dropdown-toggle" icon="l-angle-down" />
)}
</div>
</ComboboxButton>
Expand Down
6 changes: 5 additions & 1 deletion src/Components/Form/FormFields/AutocompleteMultiselect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ export const AutocompleteMutliSelect = <T, V>(
{props.isLoading ? (
<CareIcon icon="l-spinner" className="animate-spin" />
) : (
<CareIcon icon="l-angle-down" className="-mb-1.5" />
<CareIcon
id="dropdown-toggle"
icon="l-angle-down"
className="-mb-1.5"
/>
)}
</div>
</ComboboxButton>
Expand Down
1 change: 1 addition & 0 deletions src/Components/Form/MultiSelectMenuV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const MultiSelectMenuV2 = <T, V>(props: Props<T, V>) => {
)}
</div>
<CareIcon
id="dropdown-toggle"
icon="l-angle-down"
className="-mb-0.5 text-lg text-secondary-900"
/>
Expand Down
1 change: 1 addition & 0 deletions src/Components/Form/SelectMenuV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const SelectMenuV2 = <T, V>(props: SelectMenuProps<T, V>) => {
</div>
{showChevronIcon && (
<CareIcon
id="dropdown-toggle"
icon="l-angle-down"
className="-mb-0.5 text-lg text-secondary-900"
/>
Expand Down

0 comments on commit 0c4d822

Please sign in to comment.