-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from FC4E-CAT/devel
Version 1.1.0
- Loading branch information
Showing
58 changed files
with
4,486 additions
and
670 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/// <reference types="cypress"/> | ||
describe("admin", () => { | ||
beforeEach(() => { | ||
cy.kcLogout(); | ||
cy.kcLogin("admin").as("admin"); | ||
cy.visit("/profile"); | ||
}); | ||
|
||
it("accept a validation request", () => { | ||
cy.intercept( | ||
"GET", | ||
"http://localhost:8080/v1/admin/validations?size=10&page=1&sortby=asc", | ||
{ | ||
fixture: "validations/validations.json", | ||
}, | ||
).as("getValidations"); | ||
cy.intercept("GET", "http://localhost:8080/v1/admin/validations/1", { | ||
fixture: "validations/validation.json", | ||
}); | ||
// Navigate to validations list for admins | ||
cy.get("#admin_nav").click(); | ||
cy.get("#admin_validation").contains("Validations").click(); | ||
cy.wait(["@getValidations"]); | ||
cy.url().should("include", "/validations"); | ||
|
||
// Click the approve icon for the validation. | ||
cy.get("table").contains("Oxford Fertility"); | ||
cy.get(".cat-action-approve-link").click(); | ||
// Click the approve button on the validation's page. | ||
cy.get(".btn-success").click(); | ||
cy.intercept( | ||
"PUT", | ||
"http://localhost:8080/v1/admin/validations/1/update-status", | ||
{ | ||
fixture: "validations/validation_approved.json", | ||
}, | ||
).as("updateStatus"); | ||
cy.intercept( | ||
"http://localhost:8080/v1/admin/validations?size=10&page=1&sortby=asc", | ||
{ | ||
fixture: "validations/validations_approved.json", | ||
}, | ||
).as("validationsApproved"); | ||
cy.contains("Validation successfully approved."); | ||
cy.wait(["@validationsApproved"]); | ||
cy.contains("APPROVED"); | ||
}); | ||
|
||
it("declines a validation request", () => { | ||
cy.intercept( | ||
{ | ||
method: "GET", | ||
url: "http://localhost:8080/v1/admin/validations?size=10&page=1&sortby=asc", | ||
}, | ||
(req) => { | ||
if (req.alias === "rejectedValidations") { | ||
req.reply({ fixture: "validations/validations_rejected.json" }); | ||
} else { | ||
req.reply({ fixture: "validations/validations.json" }); | ||
} | ||
}, | ||
).as("getValidations"); | ||
// Navigate to validations list for admins | ||
cy.get("#admin_nav").click(); | ||
cy.get("#admin_validation").contains("Validations").click(); | ||
cy.wait(["@getValidations"]); | ||
cy.url().should("include", "/validations"); | ||
|
||
// Click the approve icon for the validation. | ||
cy.get("table").contains("Oxford Fertility"); | ||
cy.get(".cat-action-reject-link").click(); | ||
// Click the approve button on the validation's page. | ||
cy.get(".btn-danger").click(); | ||
cy.intercept( | ||
"PUT", | ||
"http://localhost:8080/v1/admin/validations/1/update-status", | ||
{ fixture: "validations/validations_rejected.json" }, | ||
); | ||
|
||
cy.contains("Validation successfully rejected."); | ||
cy.url().should("include", "/validations"); | ||
}); | ||
}); |
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,34 @@ | ||
/// <reference types="cypress"/> | ||
describe("/assess", () => { | ||
beforeEach(() => { | ||
cy.kcLogout(); | ||
cy.kcLogin("identified").as("identifiedTokens"); | ||
cy.visit("/assess"); | ||
}); | ||
|
||
it("should have actor cards that are flippable", () => { | ||
cy.get('[id^="actorCard_"]').eq(0).as("actorCard"); | ||
cy.get("@actorCard").find('[id^="frontButton_"]').click(); | ||
cy.get("@actorCard").find('[id^="frontButton_"]').should("not.exist"); | ||
cy.get("@actorCard").find('[id^="backButton_"]').click(); | ||
cy.get("@actorCard").find('[id^="assessmentButton_"]').should("exist"); | ||
}); | ||
|
||
it("should link to the public assessments page", () => { | ||
cy.get('[id^="actorCard_"]').eq(0).as("actorCard"); | ||
cy.get("@actorCard").find('[id^="assessmentButton_"]').click(); | ||
cy.url().should("include", "public-assessments"); | ||
}); | ||
it("should have working links", () => { | ||
cy.get("#view_assessments_button").should( | ||
"have.attr", | ||
"href", | ||
"/assessments", | ||
); | ||
cy.get("#assessment_form_button").should( | ||
"have.attr", | ||
"href", | ||
"/assessments/create", | ||
); | ||
}); | ||
}); |
Oops, something went wrong.