diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts new file mode 100644 index 00000000000..ae416d8d990 --- /dev/null +++ b/cypress/e2e/users_spec/user_creation.cy.ts @@ -0,0 +1,197 @@ +import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; +import FacilityPage from "../../pageobject/Facility/FacilityCreation"; +import { UserPage } from "../../pageobject/Users/UserSearch"; +import { UserCreationPage } from "../../pageobject/Users/UserCreation"; + +describe("User Creation", () => { + const userPage = new UserPage(); + const loginPage = new LoginPage(); + const userCreationPage = new UserCreationPage(); + const facilityPage = new FacilityPage(); + const assetSearchPage = new AssetSearchPage(); + const fillFacilityName = "Dummy Facility 1"; + const makeid = (length: number) => { + let result = ""; + const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; + const charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; + }; + const username = makeid(25); + const alreadylinkedusersviews = [ + "devdoctor", + "devstaff2", + "devdistrictadmin", + ]; + const EXPECTED_ERROR_MESSAGES = [ + "Please select the User Type", + "Please enter valid phone number", + "Please enter the username", + "Please enter date in YYYY/MM/DD format", + "Please enter the password", + "Confirm password is required", + "First Name is required", + "Last Name is required", + "Please enter a valid email address", + "Please select the Gender", + "Please select the state", + "Please select the district", + "Please select the local body", + ]; + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.awaitUrl("/users"); + }); + + it("create new user and verify reflection", () => { + userCreationPage.clickElementById("addUserButton"); + userCreationPage.selectFacility("Dummy Shifting Center"); + userCreationPage.typeIntoElementById("username", username); + userCreationPage.typeIntoElementById("password", "Test@123"); + userCreationPage.selectHomeFacility("Dummy Shifting Center"); + userCreationPage.typeIntoElementById("phone_number", "9999999999"); + userCreationPage.setInputDate("date_of_birth", "date-input", "25081999"); + userCreationPage.selectDropdownOption("user_type", "Doctor"); + userCreationPage.typeIntoElementById("c_password", "Test@123"); + userCreationPage.typeIntoElementById("doctor_qualification", "MBBS"); + userCreationPage.typeIntoElementById("doctor_experience_commenced_on", "2"); + userCreationPage.typeIntoElementById( + "doctor_medical_council_registration", + "123456789" + ); + userCreationPage.typeIntoElementById("first_name", "cypress test"); + userCreationPage.typeIntoElementById("last_name", "staff user"); + userCreationPage.typeIntoElementById("email", "test@test.com"); + userCreationPage.selectDropdownOption("gender", "Male"); + userCreationPage.selectDropdownOption("state", "Kerala"); + userCreationPage.selectDropdownOption("district", "Ernakulam"); + userCreationPage.clickElementById("submit"); + userCreationPage.verifyNotification("User added successfully"); + userPage.typeInSearchInput(username); + userPage.checkUsernameText(username); + userCreationPage.verifyElementContainsText("name", "cypress test"); + userCreationPage.verifyElementContainsText("role", "Doctor"); + userCreationPage.verifyElementContainsText("district", "Ernakulam"); + userCreationPage.verifyElementContainsText( + "home_facility", + "Dummy Shifting Center" + ); + userCreationPage.verifyElementContainsText("doctor-qualification", "MBBS"); + userCreationPage.verifyElementContainsText("doctor-experience", "2"); + userCreationPage.verifyElementContainsText( + "medical-council-registration", + "123456789" + ); + }); + + it("create new user form throwing mandatory field error", () => { + userCreationPage.clickElementById("addUserButton"); + userCreationPage.clickElementById("submit"); + userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); + }); + + it("view user redirection from facility page", () => { + cy.visit("/facility"); + assetSearchPage.typeSearchKeyword(fillFacilityName); + assetSearchPage.pressEnter(); + facilityPage.verifyFacilityBadgeContent(fillFacilityName); + facilityPage.visitAlreadyCreatedFacility(); + facilityPage.clickManageFacilityDropdown(); + facilityPage.clickViewUsersOption(); + userPage.verifyMultipleBadgesWithSameId(alreadylinkedusersviews); + }); + + // the below commented out codes, will be used in the upcoming refactoring of this module, since it is a inter-dependent of partially converted code, currently taking it down + + // it("link facility for user", () => { + // cy.contains("Linked Facilities").click(); + // cy.intercept(/\/api\/v1\/facility/).as("getFacilities"); + // cy.get("[name='facility']") + // .click() + // .type("Dummy Facility 1") + // .wait("@getFacilities"); + // cy.get("li[role='option']").first().click(); + // cy.intercept(/\/api\/v1\/users\/\w+\/add_facility\//).as("addFacility"); + // cy.get("button[id='link-facility']").click(); + // cy.wait("@addFacility") + // // .its("response.statusCode") + // // .should("eq", 201) + // .get("span") + // .contains("Facility - User Already has permission to this facility"); + // }); + + // describe("Edit User Profile & Error Validation", () => { + // before(() => { + // cy.loginByApi(username, "#@Cypress_test123"); + // cy.saveLocalStorage(); + // }); + + // beforeEach(() => { + // cy.restoreLocalStorage(); + // cy.awaitUrl("/user/profile"); + // cy.contains("button", "Edit User Profile").click(); + // }); + + // it("First name Field Updation " + username, () => { + // cy.get("input[name=firstName]").clear(); + // cy.contains("button[type='submit']", "Update").click(); + // cy.get("span.error-text").should("contain", "Field is required"); + // cy.get("input[name=firstName]").type("firstName updated"); + // cy.contains("button[type='submit']", "Update").click(); + // }); + + // it("Last name Field Updation " + username, () => { + // cy.get("input[name=lastName]").clear(); + // cy.contains("button[type='submit']", "Update").click(); + // cy.get("span.error-text").should("contain", "Field is required"); + // cy.get("input[name=lastName]").type("lastName updated"); + // cy.contains("button[type='submit']", "Update").click(); + // }); + + // it("Age Field Updation " + username, () => { + // cy.get("input[name=age]").clear(); + // cy.contains("button[type='submit']", "Update").click(); + // cy.get("span.error-text").should("contain", "This field is required"); + // cy.get("input[name=age]").type("11"); + // cy.contains("button[type='submit']", "Update").click(); + // }); + + // it("Phone number Field Updation " + username, () => { + // cy.get("input[name=phoneNumber]").clear(); + // cy.contains("button[type='submit']", "Update").click(); + // cy.get("span.error-text").should( + // "contain", + // "Please enter valid phone number" + // ); + // cy.get("input[name=phoneNumber]").type("+919999999999"); + // cy.contains("button[type='submit']", "Update").click(); + // }); + + // it("Whatsapp number Field Updation " + username, () => { + // cy.get("input[name=altPhoneNumber]").clear(); + // cy.get("input[name=altPhoneNumber]").type("+919999999999"); + // cy.contains("button[type='submit']", "Update").click(); + // }); + + // it("Email Field Updation " + username, () => { + // cy.get("input[name=email]").clear(); + // cy.contains("button[type='submit']", "Update").click(); + // cy.get("span.error-text").should("contain", "This field is required"); + // cy.get("input[name=email]").type("test@test.com"); + // cy.contains("button[type='submit']", "Update").click(); + // }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/e2e/users_spec/user_crud.cy.ts b/cypress/e2e/users_spec/user_crud.cy.ts deleted file mode 100644 index 41a12a891a8..00000000000 --- a/cypress/e2e/users_spec/user_crud.cy.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; - -const makeid = (length: number) => { - let result = ""; - const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; - const charactersLength = characters.length; - for (let i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; - -const username = makeid(25); -const phone_number = 9999999999; -const alt_phone_number = 9999999999; - -describe("User management", () => { - before(() => { - cy.loginByApi("devdistrictadmin", "Coronasafe@123"); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.awaitUrl("/user"); - }); - - it("create user", () => { - cy.contains("Add New User").click(); - cy.get("[id='user_type'] > div > button").click(); - cy.get("div").contains("Ward Admin").click(); - cy.get("[id='state'] > div > button").click(); - cy.get("div").contains("Kerala").click(); - cy.get("[id='district'] > div > button").click(); - cy.get("div").contains("Ernakulam").click(); - cy.get("[id='local_body'] > div > button").click(); - cy.get("div").contains("Aikaranad").click(); - cy.intercept(/\/api\/v1\/facility/).as("facility"); - cy.get("[name='facilities']") - .click() - .type("Dummy Facility 1") - .wait("@facility"); - cy.get("li[role='option']").first().click(); - cy.get("input[type='checkbox']").click(); - cy.get("[name='phone_number']").type(phone_number); - cy.get("[name='alt_phone_number']").type(alt_phone_number); - cy.intercept(/users/).as("check_availability"); - cy.get("#date_of_birth").should("be.visible").click(); - cy.get("#date-input").click().type("25081999"); - cy.get("[name='username']").type(username); - cy.wait("@check_availability").its("response.statusCode").should("eq", 200); - cy.get("[name='password']").type("#@Cypress_test123"); - cy.get("[name='c_password']").type("#@Cypress_test123"); - cy.get("[name='first_name']").type("Cypress Test"); - cy.get("[name='last_name']").type("Tester"); - cy.get("[name='email']").type("cypress@tester.com"); - cy.get("[id='gender'] > div > button").click(); - cy.get("div").contains("Male").click(); - cy.get("button[id='submit']").contains("Save User").click(); - cy.verifyNotification("User added successfully"); - }); - - it("view user and verify details", () => { - cy.contains("Advanced Filters").click(); - cy.get("[name='first_name']").type("Cypress Test"); - cy.get("[name='last_name']").type("Tester"); - cy.get("#role button").click(); - cy.contains("#role li", "Ward Admin").click(); - cy.get("input[name='district']").click(); - cy.get("input[name='district']").type("Ernakulam"); - cy.get("li[id^='headlessui-combobox-option']") - .contains("Ernakulam") - .click(); - cy.get("[placeholder='Phone Number']").click(); - cy.get("[placeholder='Phone Number']").type(phone_number); - cy.get("[placeholder='WhatsApp Phone Number']").type(alt_phone_number); - cy.contains("Apply").click(); - cy.intercept(/\/api\/v1\/users/).as("getUsers"); - cy.wait(1000); - cy.get("[name='username']").type(username); - cy.wait("@getUsers"); - cy.get("dd[id='count']").contains(/^1$/).click(); - cy.get("div[id='usr_0']").within(() => { - cy.intercept(`/api/v1/users/${username}/get_facilities/`).as( - "userFacility" - ); - cy.get("div[id='role']").contains(/^WardAdmin$/); - cy.get("div[id='name']").contains("Cypress Test Tester"); - cy.get("div[id='district']").contains(/^Ernakulam$/); - cy.get("div[id='local_body']").contains("Aikaranad"); - cy.get("div[id='created_by']").contains(/^devdistrictadmin$/); - cy.get("div[id='home_facility']").contains("No Home Facility"); - cy.get("button[id='facilities']").click(); - cy.wait("@userFacility") - .getAttached("div[id=facility_0] > div > span") - .contains("Dummy Facility 1"); - }); - }); - - it("link facility for user", () => { - cy.contains("Linked Facilities").click(); - cy.intercept(/\/api\/v1\/facility/).as("getFacilities"); - cy.get("[name='facility']") - .click() - .type("Dummy Facility 1") - .wait("@getFacilities"); - cy.get("li[role='option']").first().click(); - cy.intercept(/\/api\/v1\/users\/\w+\/add_facility\//).as("addFacility"); - cy.get("button[id='link-facility']").click(); - cy.wait("@addFacility") - // .its("response.statusCode") - // .should("eq", 201) - .get("span") - .contains("Facility - User Already has permission to this facility"); - }); - - it("Next/Previous Page", () => { - // only works for desktop mode - cy.get("button#next-pages").click(); - cy.url().should("include", "page=2"); - cy.get("button#prev-pages").click(); - cy.url().should("include", "page=1"); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); - -describe("Edit User Profile & Error Validation", () => { - before(() => { - cy.loginByApi(username, "#@Cypress_test123"); - cy.saveLocalStorage(); - }); - - beforeEach(() => { - cy.restoreLocalStorage(); - cy.awaitUrl("/user/profile"); - cy.contains("button", "Edit User Profile").click(); - }); - - it("First name Field Updation " + username, () => { - cy.get("input[name=firstName]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "Field is required"); - cy.get("input[name=firstName]").type("firstName updated"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Last name Field Updation " + username, () => { - cy.get("input[name=lastName]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "Field is required"); - cy.get("input[name=lastName]").type("lastName updated"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Age Field Updation " + username, () => { - cy.get("input[name=age]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "This field is required"); - cy.get("input[name=age]").type("11"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Phone number Field Updation " + username, () => { - cy.get("input[name=phoneNumber]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should( - "contain", - "Please enter valid phone number" - ); - cy.get("input[name=phoneNumber]").type("+919999999999"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Whatsapp number Field Updation " + username, () => { - cy.get("input[name=altPhoneNumber]").clear(); - cy.get("input[name=altPhoneNumber]").type("+919999999999"); - cy.contains("button[type='submit']", "Update").click(); - }); - - it("Email Field Updation " + username, () => { - cy.get("input[name=email]").clear(); - cy.contains("button[type='submit']", "Update").click(); - cy.get("span.error-text").should("contain", "This field is required"); - cy.get("input[name=email]").type("test@test.com"); - cy.contains("button[type='submit']", "Update").click(); - }); - - afterEach(() => { - cy.saveLocalStorage(); - }); -}); - -// describe("Delete User", () => { district admin wont be able to delete user -// it("deletes user", () => { -// cy.loginByApi("devdistrictadmin", "Coronasafe@123"); -// cy.awaitUrl("/user"); -// cy.get("[name='username']").type(username); -// cy.get("button") -// .should("contain", "Delete") -// .contains("Delete") -// .click(); -// cy.get("button.font-medium.btn.btn-danger").click(); -// }); -// }); diff --git a/cypress/e2e/users_spec/user_homepage.cy.ts b/cypress/e2e/users_spec/user_homepage.cy.ts index 40a55bad1e8..060132105e6 100644 --- a/cypress/e2e/users_spec/user_homepage.cy.ts +++ b/cypress/e2e/users_spec/user_homepage.cy.ts @@ -4,11 +4,14 @@ import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; import LoginPage from "../../pageobject/Login/LoginPage"; import { UserPage } from "../../pageobject/Users/UserSearch"; -describe("Asset Tab", () => { +describe("User Homepage", () => { const userPage = new UserPage(); const usernameToTest = "devdoctor"; const currentuser = "devdistrictadmin"; const loginPage = new LoginPage(); + const phone_number = "9876543219"; + const alt_phone_number = "9876543219"; + before(() => { loginPage.loginAsDisctrictAdmin(); cy.saveLocalStorage(); @@ -19,6 +22,38 @@ describe("Asset Tab", () => { cy.awaitUrl("/users"); }); + it("User advance filter functionality", () => { + userPage.clickAdvancedFilters(); + userPage.typeInFirstName("Dev"); + userPage.typeInLastName("Doctor"); + userPage.selectRole("Doctor"); + userPage.selectDistrict("Ernakulam"); + userPage.typeInPhoneNumber(phone_number); + userPage.typeInAltPhoneNumber(alt_phone_number); + userPage.applyFilter(); + userPage.verifyUrlafteradvancefilter(); + userPage.checkUsernameText(usernameToTest); + userPage.verifyDataTestIdText("First Name", "First Name: Dev"); + userPage.verifyDataTestIdText("Last Name", "Last Name: Doctor"); + userPage.verifyDataTestIdText( + "Phone Number", + "Phone Number: +919876543219" + ); + userPage.verifyDataTestIdText( + "WhatsApp no.", + "WhatsApp no.: +919876543219" + ); + userPage.verifyDataTestIdText("Role", "Role: Doctor"); + userPage.verifyDataTestIdText("District", "District: Ernakulam"); + userPage.clearFilters(); + userPage.verifyDataTestIdNotVisible("First Name"); + userPage.verifyDataTestIdNotVisible("Last Name"); + userPage.verifyDataTestIdNotVisible("Phone Number"); + userPage.verifyDataTestIdNotVisible("WhatsApp no."); + userPage.verifyDataTestIdNotVisible("Role"); + userPage.verifyDataTestIdNotVisible("District"); + }); + it("Search by username", () => { userPage.checkSearchInputVisibility(); userPage.typeInSearchInput(usernameToTest); @@ -33,6 +68,14 @@ describe("Asset Tab", () => { userPage.checkUsernameBadgeVisibility(false); userPage.checkUsernameText(currentuser); }); + + it("Next/Previous Page Navigation", () => { + userPage.navigateToNextPage(); + userPage.verifyCurrentPageNumber(2); + userPage.navigateToPreviousPage(); + userPage.verifyCurrentPageNumber(1); + }); + afterEach(() => { cy.saveLocalStorage(); }); diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts index e0a572ccaec..d27433f04e7 100644 --- a/cypress/pageobject/Facility/FacilityCreation.ts +++ b/cypress/pageobject/Facility/FacilityCreation.ts @@ -129,6 +129,10 @@ class FacilityPage { cy.get("#view-assets").contains("View Assets").click(); } + clickViewUsersOption() { + cy.get("#view-users").click(); + } + clickInventoryManagementOption() { cy.get("#inventory-management", { timeout: 10000 }).should("be.visible"); cy.get("#inventory-management").click(); diff --git a/cypress/pageobject/Users/UserCreation.ts b/cypress/pageobject/Users/UserCreation.ts new file mode 100644 index 00000000000..6bef3584ec8 --- /dev/null +++ b/cypress/pageobject/Users/UserCreation.ts @@ -0,0 +1,65 @@ +// UserCreation.ts +export class UserCreationPage { + clickElementById(elementId: string) { + cy.get("#" + elementId).click(); + } + + typeIntoElementById(elementId: string, value: string) { + cy.get("#" + elementId) + .click() + .type(value); + } + + typeIntoInputByName(inputName: string, value: string) { + cy.get("input[name='" + inputName + "']") + .click() + .type(value); + } + + selectOptionContainingText(text: string) { + cy.get("[role='option']").contains(text).click(); + } + + verifyNotification(message: string) { + cy.verifyNotification(message); + } + + selectFacility(name: string) { + this.typeIntoInputByName("facilities", name); + this.selectOptionContainingText(name); + } + + selectHomeFacility(name: string) { + this.clickElementById("home_facility"); + this.selectOptionContainingText(name); + } + + setInputDate( + dateElementId: string, + inputElementId: string, + dateValue: string + ) { + this.clickElementById(dateElementId); + this.typeIntoElementById(inputElementId, dateValue); + } + + selectDropdownOption(dropdownId: string, optionText: string) { + this.clickElementById(dropdownId); + this.selectOptionContainingText(optionText); + } + + verifyElementContainsText(elementId: string, expectedText: string) { + cy.get("#" + elementId).should("contain.text", expectedText); + } + + verifyErrorMessages(errorMessages: string[]) { + cy.get(".error-text").then(($errors) => { + const displayedErrorMessages = $errors + .map((_, el) => Cypress.$(el).text()) + .get(); + errorMessages.forEach((errorMessage) => { + expect(displayedErrorMessages).to.include(errorMessage); + }); + }); + } +} diff --git a/cypress/pageobject/Users/UserSearch.ts b/cypress/pageobject/Users/UserSearch.ts index 311a4b87c3a..4956532277f 100644 --- a/cypress/pageobject/Users/UserSearch.ts +++ b/cypress/pageobject/Users/UserSearch.ts @@ -22,6 +22,16 @@ export class UserPage { cy.url().should("include", `username=${username}`); } + verifyUrlafteradvancefilter() { + cy.url() + .should("include", "first_name=Dev") + .and("include", "last_name=Doctor") + .and("include", "phone_number=%2B919876543219") + .and("include", "alt_phone_number=%2B919876543219") + .and("include", "user_type=Doctor") + .and("include", "district_id=7"); + } + checkUsernameText(username: string) { cy.get(this.usernameText).should("have.text", username); } @@ -34,4 +44,69 @@ export class UserPage { clickRemoveIcon() { cy.get(this.removeIcon).click(); } + + clickAdvancedFilters() { + cy.get("#advanced-filter").contains("Advanced Filters").click(); + } + + typeInFirstName(firstName: string) { + cy.get("#first_name").click().type(firstName); + } + + typeInLastName(lastName: string) { + cy.get("#last_name").click().type(lastName); + } + + selectRole(role: string) { + cy.get("#role button").click(); + cy.get("[role='option']").contains(role).click(); + } + + selectDistrict(district: string) { + cy.get("input[name='district']").click().type(district); + cy.get("[role='option']").contains(district).click(); + } + + typeInPhoneNumber(phone: string) { + cy.get("#phone_number").click().type(phone); + } + + typeInAltPhoneNumber(altPhone: string) { + cy.get("#alt_phone_number").click().type(altPhone); + } + + applyFilter() { + cy.get("#apply-filter").click(); + } + + verifyDataTestIdText(testId: string, text: string) { + cy.get(`[data-testid="${testId}"]`).contains(text).should("be.visible"); + } + + clearFilters() { + this.clickAdvancedFilters(); + cy.get("#clear-filter").contains("Clear").click(); + } + + verifyDataTestIdNotVisible(testId: string) { + cy.get(`[data-testid="${testId}"]`).should("not.be.visible"); + } + + navigateToNextPage() { + cy.get("button#next-pages").click(); + } + + navigateToPreviousPage() { + cy.get("button#prev-pages").click(); + } + + verifyCurrentPageNumber(pageNumber: number) { + cy.url().should("include", `page=${pageNumber}`); + } + + verifyMultipleBadgesWithSameId(expectedContents: string[]) { + cy.get("#user-view-name").each((el, index) => { + expect(el.text().trim()).to.equal(expectedContents[index]); + }); + } } diff --git a/package-lock.json b/package-lock.json index fd39e761fb2..53591b555c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23728,4 +23728,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res index 63be6d2f3a4..eb4fd2b2376 100644 --- a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res +++ b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res @@ -31,7 +31,6 @@ let make = ( None }, [state]) - let handleClickOutside = %raw(` function (event, ref, hideModal) { if (ref.current && !ref.current.contains(event.target)) { @@ -56,18 +55,18 @@ let make = ( } }) -let getStatus = (min, minText, max, maxText, val) => { - switch (val >= min, val <= max) { - | (true, true) => ("Normal", "#059669") - | (true, false) => (maxText, "#DC2626") - | _ => (minText, "#DC2626") + let getStatus = (min, minText, max, maxText, val) => { + switch (val >= min, val <= max) { + | (true, true) => ("Normal", "#059669") + | (true, false) => (maxText, "#DC2626") + | _ => (minText, "#DC2626") + } } -}