Skip to content

Commit

Permalink
chore(candidate): fixed candidacy project status cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agarbe committed Sep 11, 2024
1 parent b67bdf2 commit f4cf55f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,28 @@ import { stubMutation, stubQuery } from "../utils/graphql";
context("Project", () => {
it("attempt to validate project", function () {
cy.intercept("POST", "/api/graphql", (req) => {
stubQuery(req, "getDepartments", "departments.json");
stubMutation(req, "candidate_login", "candidate1.json");
stubQuery(req, "getReferential", "referential.json");
stubMutation(req, "candidate_login", "candidate_login.json");
stubQuery(req, "candidate_getCandidateWithCandidacy", "candidate1.json");
stubQuery(req, "activeFeaturesForConnectedUser", "features.json");
});
cy.login();
cy.wait("@candidate_login");
cy.wait("@getReferential");
cy.wait("@candidate_getCandidateWithCandidacy");
cy.wait("@activeFeaturesForConnectedUser");

cy.get('[data-test="project-home-validate"]').should("be.disabled");
});

it("confirm registration", function () {
cy.intercept("POST", "/api/graphql", (req) => {
stubQuery(req, "getDepartments", "departments.json");
stubMutation(req, "candidate_login", "candidate2.json");
stubQuery(req, "getReferential", "referential.json");
stubMutation(req, "candidate_login", "candidate_login.json");
stubQuery(req, "candidate_getCandidateWithCandidacy", "candidate2.json");
stubQuery(req, "submit_candidacy", "submitted-candidacy.json");
stubQuery(req, "activeFeaturesForConnectedUser", "features.json");
});
cy.login();
cy.get('[data-test="project-home-loading"]');
cy.wait("@candidate_login");
cy.wait("@getReferential");
cy.wait("@candidate_getCandidateWithCandidacy");
cy.wait("@activeFeaturesForConnectedUser");

cy.wait(500);
Expand Down
109 changes: 51 additions & 58 deletions packages/reva-candidate/cypress/fixtures/candidate2.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
{
"data": {
"candidateLogged": {
"tokens": {
"accessToken": "abc",
"refreshToken": "def",
"idToken": "ghi"
},
"candidate": {
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "06-01-02-03-04",
"candidacy": {
"id": "c2",
"organism": {
"id": "o1",
"label": "Accompagnateur 1",
"address": "1 rue de l'exemple",
"zip": "75000",
"city": "Paris",
"contactAdministrativeEmail": "[email protected]"
},
"createdAt": 1664376421912,
"certification": {
"id": "c1",
"label": "Titre 1",
"summary": "résumé 1",
"codeRncp": "34691",
"status": "AVAILABLE"
},
"experiences": [
{
"id": "e1",
"title": "Experience 1",
"startedAt": 1580428800000,
"duration": "unknown",
"description": "description 1"
}
],
"goals": [
{
"id": "goal1"
}
],
"candidacyStatuses": [
{
"status": "PROJET",
"isActive": true
}
],
"appointmentCount": 0,
"certificateSkills": null,
"otherTraining": null,
"individualHourCount": null,
"collectiveHourCount": null,
"additionalHourCount": null,
"basicSkills": [],
"mandatoryTrainings": []
}
"candidate_getCandidateWithCandidacy": {
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"phone": "06-01-02-03-04",
"candidacy": {
"id": "c2",
"organism": {
"id": "o1",
"label": "Accompagnateur 1",
"address": "1 rue de l'exemple",
"zip": "75000",
"city": "Paris",
"contactAdministrativeEmail": "[email protected]"
},
"createdAt": 1664376421912,
"certification": {
"id": "c1",
"label": "Titre 1",
"summary": "résumé 1",
"codeRncp": "34691",
"status": "AVAILABLE"
},
"experiences": [
{
"id": "e1",
"title": "Experience 1",
"startedAt": 1580428800000,
"duration": "unknown",
"description": "description 1"
}
],
"goals": [
{
"id": "goal1"
}
],
"candidacyStatuses": [
{
"status": "PROJET",
"isActive": true
}
],
"appointmentCount": 0,
"certificateSkills": null,
"otherTraining": null,
"individualHourCount": null,
"collectiveHourCount": null,
"additionalHourCount": null,
"basicSkills": [],
"mandatoryTrainings": []
}
}
}
Expand Down

0 comments on commit f4cf55f

Please sign in to comment.