-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SteveGT96
committed
Oct 9, 2024
1 parent
cc62441
commit bdd55c3
Showing
8 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
cypress/integrations/admin_activities/hospital/edit_hospital.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/// <reference types="cypress" /> | ||
|
||
const STARTS_PATH = "/admin"; | ||
|
||
describe("Edit Hospital Activity specs", () => { | ||
it("should render the ui", () => { | ||
cy.authenticate(STARTS_PATH); | ||
cy.dataCy("hospital-infos").click(); | ||
cy.dataCy("edit-hospital").click(); | ||
cy.dataCy("activity-title").contains("Edit hospital"); | ||
}); | ||
|
||
it("should fail to edit the hospitalInfo", () => { | ||
cy.byId("description").clear().type("FAIL"); | ||
cy.byId("email").clear().type("[email protected]"); | ||
cy.dataCy("submit-form").click(); | ||
cy.dataCy("dialog-info").should("not.exist"); | ||
cy.dataCy("info-box").contains("Invalid payload"); | ||
}); | ||
|
||
it("should successfully save hospital infos changes", () => { | ||
cy.byId("description").clear().type("St. LUKE Hospital"); | ||
cy.byId("email").clear().type("[email protected]"); | ||
cy.byId("currencyCod").clear().type("FCFA"); | ||
cy.dataCy("submit-form").click(); | ||
cy.dataCy("dialog-info").contains("updated successfully"); | ||
cy.dataCy("approve-dialog").click(); | ||
}); | ||
|
||
it("should redirect after hospital info update", () => { | ||
cy.dataCy("activity-title").contains("Wards"); | ||
}); | ||
|
||
it("should cancel the discard of the hospital infos", () => { | ||
cy.dataCy("edit-hospital").first().click(); | ||
cy.dataCy("cancel-form").click(); | ||
cy.dataCy("dialog-info").contains("lost"); | ||
cy.dataCy("close-dialog").click().click(); | ||
cy.dataCy("dialog-info").should("not.be.visible"); | ||
}); | ||
|
||
it("should cancel the update of the hospital infos", () => { | ||
cy.dataCy("cancel-form").click(); | ||
cy.dataCy("dialog-info").contains("lost"); | ||
cy.dataCy("approve-dialog").click(); | ||
cy.dataCy("activity-title").contains("Wards"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters