-
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
Showing
6 changed files
with
90 additions
and
12 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...s/integrations/admin_activities/types_activities/ages_activities/edit_ages_activity.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,50 @@ | ||
/// <reference types="cypress" /> | ||
|
||
const AGE_TYPE_START_PATH = "/admin/types/ages"; | ||
|
||
describe("Admission types Edit Activity specs", () => { | ||
it("should render the ui", () => { | ||
cy.authenticate(AGE_TYPE_START_PATH); | ||
cy.dataCy("sub-activity-title").contains("Manage age types"); | ||
}); | ||
|
||
it("should show age types edit form", () => { | ||
cy.dataCy("edit-age-types").click(); | ||
cy.dataCy("sub-activity-title").contains("Edit age types"); | ||
}); | ||
|
||
it("should fail to edit the age type", () => { | ||
cy.byId("ageTypes\\[0\\]\\.to").type("1"); | ||
cy.dataCy("submit-form").click(); | ||
cy.dataCy("dialog-info").should("not.exist"); | ||
}); | ||
|
||
it("should successfully save age types changes", () => { | ||
cy.byId("ageTypes\\[0\\]\\.to").clear().type("0"); | ||
cy.byId("ageTypes\\[5\\]\\.to").clear().type("104"); | ||
cy.dataCy("submit-form").click(); | ||
cy.dataCy("dialog-info").contains("have been updated successfully!"); | ||
cy.dataCy("approve-dialog").click(); | ||
}); | ||
|
||
it("should redirect after age types update", () => { | ||
cy.dataCy("sub-activity-title").contains("Manage age types"); | ||
}); | ||
|
||
it("should cancel the cancellation of the age types update", () => { | ||
cy.dataCy("edit-age-types").click(); | ||
cy.dataCy("cancel-form").click(); | ||
cy.dataCy("dialog-info").contains( | ||
"Are you sure to cancel the age types update?" | ||
); | ||
cy.dataCy("close-dialog").click(); | ||
cy.dataCy("dialog-info").should("not.exist"); | ||
}); | ||
|
||
it("should cancel the age types update", () => { | ||
cy.dataCy("cancel-form").click(); | ||
cy.dataCy("approve-dialog").click(); | ||
cy.dataCy("dialog-info").should("not.exist"); | ||
cy.dataCy("sub-activity-title").contains("Manage age types"); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
...integrations/admin_activities/types_activities/ages_activities/manage_ages_activity.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,19 @@ | ||
/// <reference types="cypress" /> | ||
|
||
const AGE_TYPES_START_PATH = "/admin/types/ages"; | ||
|
||
describe("Age types Activity specs", () => { | ||
it("should render the ui", () => { | ||
cy.authenticate(AGE_TYPES_START_PATH); | ||
cy.dataCy("sub-activity-title").contains("Manage age types"); | ||
}); | ||
|
||
it("should present the table with 6 rows", () => { | ||
cy.dataCy("age-types-table") | ||
.find("table") | ||
.then(($table) => { | ||
const rows = $table.find("tbody tr"); | ||
expect(rows.length).equal(6); | ||
}); | ||
}); | ||
}); |
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