-
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.
update all instances of formatRawProjectTypes
- Loading branch information
1 parent
b484df1
commit b1b9050
Showing
17 changed files
with
164 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,31 +58,13 @@ describe("sendAgentAndPayeeConfirmationEmail", () => { | |
], | ||
}, | ||
}); | ||
queryMock.mockQuery({ | ||
name: "LookupHumanReadableProjectType", | ||
variables: { | ||
rawList: [ | ||
"alter.internal", | ||
"alter.openings.add.doors.rear", | ||
"alter.facades.paint", | ||
], | ||
}, | ||
data: { | ||
projectTypes: [ | ||
{ description: "internal alterations" }, | ||
{ description: "addition of doorways to the rear of the building" }, | ||
{ description: "painting of facades" }, | ||
], | ||
}, | ||
}); | ||
|
||
const expectedConfig = { | ||
personalisation: { | ||
applicantName: "xyz", | ||
payeeName: "payeeName", | ||
address: "123 PLACE", | ||
projectType: | ||
"Internal alterations, addition of doorways to the rear of the building, and painting of facades", | ||
projectType: "Paint the facade and changes to internal walls or layout", | ||
emailReplyToId: "123", | ||
helpEmail: "[email protected]", | ||
helpOpeningHours: "9-5", | ||
|
7 changes: 4 additions & 3 deletions
7
api.planx.uk/modules/pay/service/inviteToPay/sendConfirmationEmail.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
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 |
---|---|---|
|
@@ -13,25 +13,6 @@ import { Team } from "@opensystemslab/planx-core/types"; | |
const ENDPOINT = "/resume-application"; | ||
const TEST_EMAIL = "[email protected]"; | ||
|
||
const mockFormatRawProjectTypes = jest | ||
.fn() | ||
.mockResolvedValue(["New office premises"]); | ||
|
||
jest.mock("@opensystemslab/planx-core", () => { | ||
const actualCoreDomainClient = jest.requireActual( | ||
"@opensystemslab/planx-core", | ||
).CoreDomainClient; | ||
|
||
return { | ||
CoreDomainClient: class extends actualCoreDomainClient { | ||
constructor() { | ||
super(); | ||
this.formatRawProjectTypes = () => mockFormatRawProjectTypes(); | ||
} | ||
}, | ||
}; | ||
}); | ||
|
||
describe("buildContentFromSessions function", () => { | ||
it("should return correctly formatted content for a single session", async () => { | ||
const sessions: PartialDeep<LowCalSession>[] = [ | ||
|
@@ -57,7 +38,7 @@ describe("buildContentFromSessions function", () => { | |
|
||
const result = `Service: Apply for a Lawful Development Certificate | ||
Address: 1 High Street | ||
Project type: New office premises | ||
Project type: New offices | ||
Expiry Date: 29 May 2026 | ||
Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123`; | ||
expect( | ||
|
@@ -127,15 +108,15 @@ describe("buildContentFromSessions function", () => { | |
]; | ||
const result = `Service: Apply for a Lawful Development Certificate | ||
Address: 1 High Street | ||
Project type: New office premises | ||
Project type: New offices | ||
Expiry Date: 29 May 2026 | ||
Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123\n\nService: Apply for a Lawful Development Certificate | ||
Address: 2 High Street | ||
Project type: New office premises | ||
Project type: New offices | ||
Expiry Date: 29 May 2026 | ||
Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=456\n\nService: Apply for a Lawful Development Certificate | ||
Address: 3 High Street | ||
Project type: New office premises | ||
Project type: New offices | ||
Expiry Date: 29 May 2026 | ||
Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=789`; | ||
expect( | ||
|
@@ -187,7 +168,7 @@ describe("buildContentFromSessions function", () => { | |
]; | ||
const result = `Service: Apply for a Lawful Development Certificate | ||
Address: 1 High Street | ||
Project type: New office premises | ||
Project type: New offices | ||
Expiry Date: 29 May 2026 | ||
Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123`; | ||
expect( | ||
|
@@ -220,7 +201,7 @@ describe("buildContentFromSessions function", () => { | |
|
||
const result = `Service: Apply for a Lawful Development Certificate | ||
Address: Address not submitted | ||
Project type: New office premises | ||
Project type: New offices | ||
Expiry Date: 29 May 2026 | ||
Link: example.com/team/apply-for-a-lawful-development-certificate/published?sessionId=123`; | ||
expect( | ||
|
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 |
---|---|---|
|
@@ -15,10 +15,6 @@ import { CoreDomainClient } from "@opensystemslab/planx-core"; | |
const TEST_EMAIL = "[email protected]"; | ||
const SAVE_ENDPOINT = "/send-email/save"; | ||
|
||
jest | ||
.spyOn(CoreDomainClient.prototype, "formatRawProjectTypes") | ||
.mockResolvedValue("New office premises"); | ||
|
||
describe("Send Email endpoint", () => { | ||
beforeEach(() => { | ||
queryMock.reset(); | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@airbrake/node": "^2.1.8", | ||
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7666a78", | ||
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#eb3b635", | ||
"@types/isomorphic-fetch": "^0.0.36", | ||
"adm-zip": "^0.5.10", | ||
"aws-sdk": "^2.1467.0", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"@cucumber/cucumber": "^9.3.0", | ||
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7666a78", | ||
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#eb3b635", | ||
"axios": "^1.6.8", | ||
"dotenv": "^16.3.1", | ||
"dotenv-expand": "^10.0.0", | ||
|
Oops, something went wrong.