-
Notifications
You must be signed in to change notification settings - Fork 2
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
2 changed files
with
40 additions
and
0 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 |
---|---|---|
|
@@ -531,7 +531,33 @@ it("CRUD on proposal", async () => { | |
}); | ||
}); | ||
|
||
describe("Proposal update tests", () => { | ||
it("Update of a proposal with the supervisor in the list of co-supervisors", async () => { | ||
logIn("[email protected]"); | ||
const inserted_proposal_id = (await insertProposal(proposal)).body; | ||
proposal.co_supervisors.push("[email protected]"); | ||
const response = await modifyProposal(inserted_proposal_id, proposal); | ||
expect(response.status).toBe(400); | ||
expect(response.body).toEqual({ | ||
message: | ||
"The supervisor's email is included in the list of co-supervisors", | ||
}); | ||
}); | ||
}); | ||
|
||
describe("Proposal insertion tests", () => { | ||
it("Insertion of a proposal with the supervisor in the list of co-supervisors", async () => { | ||
logIn("[email protected]"); | ||
proposal.co_supervisors.push("[email protected]"); | ||
const response = await insertProposal(proposal); | ||
expect(response.status).toBe(400); | ||
expect(response.body).toEqual({ | ||
message: | ||
"The supervisor's email is included in the list of co-supervisors", | ||
}); | ||
const returned_proposals = (await getProposals()).body; | ||
expect(returned_proposals).toHaveLength(0); | ||
}); | ||
it("Insertion of a proposal with no notes", async () => { | ||
proposal.notes = null; | ||
|
||
|
@@ -698,6 +724,9 @@ describe("Proposal expiration tests (no virtual clock)", () => { | |
|
||
// the professor inserts a proposal | ||
logIn("[email protected]"); | ||
proposal.co_supervisors = proposal.co_supervisors.filter( | ||
(co_supervisor) => co_supervisor !== "[email protected]", | ||
); | ||
const inserted_proposal_id = (await insertProposal(proposal)).body; | ||
|
||
// the student applies for the proposal | ||
|
@@ -714,6 +743,9 @@ describe("Proposal expiration tests (no virtual clock)", () => { | |
logIn("[email protected]"); | ||
proposal.expiration_date = dayjs().add(1, "day").format("YYYY-MM-DD"); | ||
proposal.groups = ["ELITE"]; | ||
proposal.co_supervisors = proposal.co_supervisors.filter( | ||
(co_supervisor) => co_supervisor !== "[email protected]", | ||
); | ||
const notExpiredProposalId = (await insertProposal(proposal)).body; | ||
|
||
// the same student, now that the previous proposal is expired, can apply to another proposal | ||
|
@@ -775,6 +807,9 @@ describe("Proposal expiration tests (no virtual clock)", () => { | |
|
||
// the professor inserts a proposal | ||
logIn("[email protected]"); | ||
proposal.co_supervisors = proposal.co_supervisors.filter( | ||
(co_supervisor) => co_supervisor !== "[email protected]", | ||
); | ||
const inserted_proposal_id = (await insertProposal(proposal)).body; | ||
|
||
// the proposal expires | ||
|