diff --git a/cypress/e2e/shifting_spec/filter.cy.ts b/cypress/e2e/shifting_spec/filter.cy.ts index f1068f7c53a..3790198a4db 100644 --- a/cypress/e2e/shifting_spec/filter.cy.ts +++ b/cypress/e2e/shifting_spec/filter.cy.ts @@ -19,7 +19,7 @@ describe("Shifting section filter", () => { shiftingPage.filterByFacility( "Dummy Shifting", "Dummy Shifting", - "District Admin" + "District" ); shiftingPage.facilityAssignedBadge().should("exist"); diff --git a/cypress/e2e/users_spec/user_manage.cy.ts b/cypress/e2e/users_spec/user_manage.cy.ts index db865dc8126..9fe3aea75f9 100644 --- a/cypress/e2e/users_spec/user_manage.cy.ts +++ b/cypress/e2e/users_spec/user_manage.cy.ts @@ -2,6 +2,7 @@ import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; import LoginPage from "../../pageobject/Login/LoginPage"; import { UserPage } from "../../pageobject/Users/UserSearch"; import ManageUserPage from "../../pageobject/Users/ManageUserPage"; +import { UserCreationPage } from "../../pageobject/Users/UserCreation"; describe("Manage User", () => { const loginPage = new LoginPage(); @@ -11,6 +12,7 @@ describe("Manage User", () => { const usernametolinkfacilitydoc2 = "dummydoctor5"; const usernametolinkfacilitydoc3 = "dummydoctor6"; const usernametolinkskill = "devdoctor"; + const userCreationPage = new UserCreationPage(); const usernameforworkinghour = "devdistrictadmin"; const usernamerealname = "Dummy Doctor"; const facilitytolinkusername = "Dummy Shifting Center"; @@ -37,7 +39,16 @@ describe("Manage User", () => { manageUserPage.selectFacilityFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); + cy.wait(5000); + manageUserPage.clicklinkedskillbutton(); + manageUserPage.assertSkillInAddedUserSkills(linkedskill); + manageUserPage.clickCloseSlideOver(); + cy.wait(5000); manageUserPage.navigateToProfile(); + userCreationPage.verifyElementContainsText( + "username-profile-details", + usernameforworkinghour + ); manageUserPage.assertSkillInAlreadyLinkedSkills(linkedskill); }); diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index 1b340c875ee..b79b96447f0 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -73,7 +73,9 @@ export class ManageUserPage { } navigateToProfile() { + cy.intercept("GET", "**/api/v1/users/**").as("getUsers"); cy.get("#profilenamelink").click(); + cy.wait("@getUsers").its("response.statusCode").should("eq", 200); } verifyWorkingHours(expectedHours: string) { diff --git a/package.json b/package.json index 1ec0e88f48f..ca3f6920a12 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "@typescript-eslint/parser": "^5.61.0", "@vitejs/plugin-react-swc": "^3.3.2", "autoprefixer": "^10.4.14", - "cypress": "^13.1.0", + "cypress": "^13.5.0", "cypress-localstorage-commands": "^2.2.3", "eslint": "^8.44.0", "eslint-config-prettier": "^8.8.0", diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx index 26bed83635b..0eae504399c 100644 --- a/src/Components/Facility/CentralNursingStation.tsx +++ b/src/Components/Facility/CentralNursingStation.tsx @@ -168,11 +168,15 @@ export default function CentralNursingStation({ facilityId }: Props) { Filter by Location -
+
updateQuery({ location })} + setSelected={(location) => { + location + ? updateQuery({ location }) + : removeFilter("location"); + }} selected={qParams.location} showAll={false} multiple={false} @@ -180,16 +184,6 @@ export default function CentralNursingStation({ facilityId }: Props) { errors="" errorClassName="hidden" /> - {qParams.location && ( - removeFilter("location")} - > - Clear - - )}
{ : "button-primary-border bg-primary-100" }`} > - + Live Patients / Total beds {" "} Filter by Location -
+
updateQuery({ location })} + setSelected={(location) => { + location + ? updateQuery({ location }) + : removeFilter("location"); + }} selected={qParams.location} showAll={false} multiple={false} @@ -149,16 +153,6 @@ export default function LiveFeedScreen({ facilityId }: Props) { errors="" errorClassName="hidden" /> - {qParams.location && ( - removeFilter("location")} - > - Clear - - )}