From 5c39fc37dade348a04e488c579ca1cd3c10cfe53 Mon Sep 17 00:00:00 2001 From: kihan2518B Date: Sat, 14 Dec 2024 11:11:07 +0530 Subject: [PATCH] modified FacilityCreation test and some validation in BedCapacity. --- cypress/e2e/facility_spec/FacilityCreation.cy.ts | 6 +----- src/components/Facility/BedCapacity.tsx | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/facility_spec/FacilityCreation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts index 5f6b4cfdb94..22132a41a79 100644 --- a/cypress/e2e/facility_spec/FacilityCreation.cy.ts +++ b/cypress/e2e/facility_spec/FacilityCreation.cy.ts @@ -50,11 +50,7 @@ describe("Facility Creation", () => { "Required", "Invalid Phone Number", ]; - const bedErrorMessage = [ - "This field is required", - "Total capacity cannot be 0", - "This field is required", - ]; + const bedErrorMessage = ["This field is required", "This field is required"]; const doctorErrorMessage = [ "This field is required", "This field is required", diff --git a/src/components/Facility/BedCapacity.tsx b/src/components/Facility/BedCapacity.tsx index a4d0b44f2be..9a22a9db8b5 100644 --- a/src/components/Facility/BedCapacity.tsx +++ b/src/components/Facility/BedCapacity.tsx @@ -118,7 +118,7 @@ export const BedCapacity = (props: BedCapacityProps) => { if (!form[field]) { errors[field] = t("field_required"); validForm = false; - } else if (field === "currentOccupancy" && Number(form[field] < 0)) { + } else if (field === "currentOccupancy") { if (Number(form[field] < 0)) { errors[field] = "Occupied cannot be negative"; validForm = false;