Skip to content

Commit

Permalink
modified FacilityCreation test and some validation in BedCapacity.
Browse files Browse the repository at this point in the history
  • Loading branch information
kihan2518B committed Dec 14, 2024
1 parent 57073e8 commit 5c39fc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Facility/BedCapacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5c39fc3

Please sign in to comment.