-
Notifications
You must be signed in to change notification settings - Fork 4
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
29 changed files
with
242 additions
and
248 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,11 +425,11 @@ describe("PgConventionRepository", () => { | |
}); | ||
|
||
it("Retrieves federated identity if exists", async () => { | ||
const peConnectId: FtConnectToken = "bbbbac99-9c0b-bbbb-bb6d-6bb9bd38bbbb"; | ||
const ftConnectId: FtConnectToken = "bbbbac99-9c0b-bbbb-bb6d-6bb9bd38bbbb"; | ||
const convention = conventionStylisteBuilder | ||
.withFederatedIdentity({ | ||
provider: "peConnect", | ||
token: peConnectId, | ||
token: ftConnectId, | ||
payload: { | ||
advisor: { | ||
email: "[email protected]", | ||
|
@@ -444,7 +444,7 @@ describe("PgConventionRepository", () => { | |
await db | ||
.insertInto("partners_pe_connect") | ||
.values({ | ||
user_pe_external_id: peConnectId, | ||
user_pe_external_id: ftConnectId, | ||
convention_id: convention.id, | ||
email: "[email protected]", | ||
firstname: "John", | ||
|
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 |
---|---|---|
|
@@ -443,25 +443,25 @@ describe("Get Convention", () => { | |
}); | ||
|
||
it("user is a PeAdvisor", async () => { | ||
const peAdvisorEmail = "[email protected]"; | ||
const peConnectedConvention = new ConventionDtoBuilder(convention) | ||
const ftAdvisorEmail = "[email protected]"; | ||
const ftConnectedConvention = new ConventionDtoBuilder(convention) | ||
.withFederatedIdentity({ | ||
provider: "peConnect", | ||
token: "some-id", | ||
payload: { | ||
advisor: { | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
firstName: "john", | ||
lastName: "doe", | ||
type: "PLACEMENT", | ||
}, | ||
}, | ||
}) | ||
.build(); | ||
uow.conventionRepository.setConventions([peConnectedConvention]); | ||
uow.conventionRepository.setConventions([ftConnectedConvention]); | ||
const payload: ConventionJwtPayload = { | ||
role: "validator", | ||
emailHash: stringToMd5(peAdvisorEmail), | ||
emailHash: stringToMd5(ftAdvisorEmail), | ||
applicationId: convention.id, | ||
iat: 1, | ||
version: 1, | ||
|
@@ -473,7 +473,7 @@ describe("Get Convention", () => { | |
); | ||
|
||
expectToEqual(conventionResult, { | ||
...peConnectedConvention, | ||
...ftConnectedConvention, | ||
agencyName: agency.name, | ||
agencyDepartment: agency.address.departmentCode, | ||
agencyKind: agency.kind, | ||
|
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 |
---|---|---|
|
@@ -2,8 +2,8 @@ import { | |
AgencyDtoBuilder, | ||
ConventionDto, | ||
ConventionDtoBuilder, | ||
FtConnectIdentity, | ||
InclusionConnectedUserBuilder, | ||
PeConnectIdentity, | ||
expectToEqual, | ||
frontRoutes, | ||
} from "shared"; | ||
|
@@ -70,8 +70,8 @@ describe("NotifyConventionNeedsReview", () => { | |
}, | ||
); | ||
|
||
const peAdvisorEmail = "[email protected]"; | ||
const peIdentity: PeConnectIdentity = { | ||
const ftAdvisorEmail = "[email protected]"; | ||
const ftIdentity: FtConnectIdentity = { | ||
provider: "peConnect", | ||
token: "123", | ||
}; | ||
|
@@ -273,7 +273,7 @@ describe("NotifyConventionNeedsReview", () => { | |
defaultConvention, | ||
) | ||
.withStatus("IN_REVIEW") | ||
.withFederatedIdentity(peIdentity) | ||
.withFederatedIdentity(ftIdentity) | ||
.build(); | ||
|
||
const shortLinkIds = [ | ||
|
@@ -287,12 +287,12 @@ describe("NotifyConventionNeedsReview", () => { | |
const userConventionAdvisor: ConventionFtUserAdvisorEntity = { | ||
_entityName: "ConventionFranceTravailAdvisor", | ||
advisor: { | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
firstName: "Elsa", | ||
lastName: "Oldenburg", | ||
type: "CAPEMPLOI", | ||
}, | ||
peExternalId: peIdentity.token, | ||
peExternalId: ftIdentity.token, | ||
conventionId: conventionInReviewWithPeAdvisor.id, | ||
}; | ||
|
||
|
@@ -348,18 +348,18 @@ describe("NotifyConventionNeedsReview", () => { | |
defaultConvention, | ||
) | ||
.withStatus("IN_REVIEW") | ||
.withFederatedIdentity(peIdentity) | ||
.withFederatedIdentity(ftIdentity) | ||
.build(); | ||
|
||
const userConventionAdvisor: ConventionFtUserAdvisorEntity = { | ||
_entityName: "ConventionFranceTravailAdvisor", | ||
advisor: { | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
firstName: "Elsa", | ||
lastName: "Oldenburg", | ||
type: "CAPEMPLOI", | ||
}, | ||
peExternalId: peIdentity.token, | ||
peExternalId: ftIdentity.token, | ||
conventionId: conventionInReviewWithPeAdvisor.id, | ||
}; | ||
|
||
|
@@ -376,7 +376,7 @@ describe("NotifyConventionNeedsReview", () => { | |
id: conventionInReviewWithPeAdvisor.id, | ||
role: "validator", | ||
targetRoute: frontRoutes.conventionStatusDashboard, | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
now: timeGateway.now(), | ||
}), | ||
[shortLinkIds[1]]: fakeGenerateMagicLinkUrlFn({ | ||
|
@@ -397,7 +397,7 @@ describe("NotifyConventionNeedsReview", () => { | |
id: conventionInReviewWithPeAdvisor.id, | ||
role: "validator", | ||
targetRoute: frontRoutes.manageConvention, | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
now: timeGateway.now(), | ||
}), | ||
[shortLinkIds[4]]: fakeGenerateMagicLinkUrlFn({ | ||
|
@@ -420,7 +420,7 @@ describe("NotifyConventionNeedsReview", () => { | |
emails: [ | ||
{ | ||
kind: "NEW_CONVENTION_REVIEW_FOR_ELIGIBILITY_OR_VALIDATION", | ||
recipients: [peAdvisorEmail], | ||
recipients: [ftAdvisorEmail], | ||
params: { | ||
conventionId: conventionInReviewWithPeAdvisor.id, | ||
internshipKind: conventionInReviewWithPeAdvisor.internshipKind, | ||
|
@@ -617,18 +617,18 @@ describe("NotifyConventionNeedsReview", () => { | |
const conventionAcceptedByCounsellorWithPeAdvisor = | ||
new ConventionDtoBuilder(defaultConvention) | ||
.withStatus("ACCEPTED_BY_COUNSELLOR") | ||
.withFederatedIdentity(peIdentity) | ||
.withFederatedIdentity(ftIdentity) | ||
.build(); | ||
|
||
const userConventionAdvisor: ConventionFtUserAdvisorEntity = { | ||
_entityName: "ConventionFranceTravailAdvisor", | ||
advisor: { | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
firstName: "Elsa", | ||
lastName: "Oldenburg", | ||
type: "CAPEMPLOI", | ||
}, | ||
peExternalId: peIdentity.token, | ||
peExternalId: ftIdentity.token, | ||
conventionId: conventionAcceptedByCounsellorWithPeAdvisor.id, | ||
}; | ||
|
||
|
@@ -645,7 +645,7 @@ describe("NotifyConventionNeedsReview", () => { | |
id: conventionAcceptedByCounsellorWithPeAdvisor.id, | ||
role: "validator", | ||
targetRoute: frontRoutes.conventionStatusDashboard, | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
now: timeGateway.now(), | ||
}), | ||
[shortLinkIds[1]]: fakeGenerateMagicLinkUrlFn({ | ||
|
@@ -666,7 +666,7 @@ describe("NotifyConventionNeedsReview", () => { | |
id: conventionAcceptedByCounsellorWithPeAdvisor.id, | ||
role: "validator", | ||
targetRoute: frontRoutes.manageConvention, | ||
email: peAdvisorEmail, | ||
email: ftAdvisorEmail, | ||
now: timeGateway.now(), | ||
}), | ||
[shortLinkIds[4]]: fakeGenerateMagicLinkUrlFn({ | ||
|
@@ -689,7 +689,7 @@ describe("NotifyConventionNeedsReview", () => { | |
emails: [ | ||
{ | ||
kind: "NEW_CONVENTION_REVIEW_FOR_ELIGIBILITY_OR_VALIDATION", | ||
recipients: [peAdvisorEmail], | ||
recipients: [ftAdvisorEmail], | ||
params: { | ||
conventionId: conventionAcceptedByCounsellorWithPeAdvisor.id, | ||
internshipKind: | ||
|
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 |
---|---|---|
|
@@ -3,8 +3,8 @@ import { | |
AgencyWithUsersRights, | ||
ConventionDto, | ||
ConventionDtoBuilder, | ||
FtConnectIdentity, | ||
InclusionConnectedUserBuilder, | ||
PeConnectIdentity, | ||
expectToEqual, | ||
frontRoutes, | ||
} from "shared"; | ||
|
@@ -299,7 +299,7 @@ describe("NotifyToAgencyConventionSubmitted", () => { | |
"shortlink4", | ||
]; | ||
shortLinkIdGeneratorGateway.addMoreShortLinkIds(shortLinkIds); | ||
const peIdentity: PeConnectIdentity = { | ||
const peIdentity: FtConnectIdentity = { | ||
provider: "peConnect", | ||
token: "123", | ||
}; | ||
|
@@ -399,7 +399,7 @@ describe("NotifyToAgencyConventionSubmitted", () => { | |
shortLinkIdGeneratorGateway.addMoreShortLinkIds(shortLinkIds); | ||
|
||
const peAdvisorEmail = "[email protected]"; | ||
const peIdentity: PeConnectIdentity = { | ||
const peIdentity: FtConnectIdentity = { | ||
provider: "peConnect", | ||
token: "123", | ||
}; | ||
|
Oops, something went wrong.