Skip to content

Commit

Permalink
update cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu1902 committed Jan 11, 2024
1 parent e3ae83a commit 85e088a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,21 @@ describe("Location Management Section", () => {

it("Delete location", () => {
cy.awaitUrl("/facility");
cy.get("a").contains("Dummy Facility 1").click();
cy.get("button[id=headlessui-menu-button-:r3:]").click();
cy.get("div[id=location-management]").click();
cy.get("a").contains("Dummy Facility 2").click().wait(1000);
cy.get("button").contains("Manage Facility").click().wait(100);
cy.get("div[id=location-management]").click().wait(1000);

// create new location
cy.get("button[id=add-new-location]").click();
cy.get("button[id=add-new-location]").click().wait(1000);
cy.get("input[id=name]").type("Test Location");
cy.get("button[id=headlessui-listbox-button-:r16:]").click();
cy.get("div[id=location-type]").click();
cy.get("li[id=location-type-option-OTHER]").click();
cy.get("button[id=submit]").click();
cy.get("button[id=submit]").click().wait(1000);

// delete location
cy.get("button[id=delete-location-button]").click();
cy.get("button[id=delete-location-button]").click().wait(1000);
cy.get("button[id=submit]").click();
cy.contains("Location Test Location deleted successfully").should("exist");
});

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Facility/LocationManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function LocationManagement({ facilityId }: Props) {
});
if (res?.res?.status === 204) {
Notification.Success({
msg: `Location ${showDeletePopup.name} deleted succcessully`,
msg: `Location ${showDeletePopup.name} deleted successully`,
});
PaginatedList.Refresh;
} else {
Expand Down

0 comments on commit 85e088a

Please sign in to comment.