-
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
1 parent
a984c15
commit 02b987b
Showing
4 changed files
with
114 additions
and
225 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 |
---|---|---|
|
@@ -3,8 +3,8 @@ import supertest from "supertest"; | |
import { queryMock } from "../../../tests/graphqlQueryMock"; | ||
import { authHeader, getJWT } from "../../../tests/mockJWT"; | ||
import app from "../../../server"; | ||
import { FlowGraph } from "@opensystemslab/planx-core/types"; | ||
import { userContext } from "../../auth/middleware"; | ||
import { mockFlowData } from "../../../tests/mocks/validateAndPublishMocks"; | ||
|
||
beforeAll(() => { | ||
const getStoreMock = jest.spyOn(userContext, "getStore"); | ||
|
@@ -154,113 +154,3 @@ describe("publish", () => { | |
}); | ||
}); | ||
}); | ||
|
||
const mockFlowData: FlowGraph = { | ||
_root: { | ||
edges: [ | ||
"SectionOne", | ||
"QuestionOne", | ||
"InternalPortalNode", | ||
"FindPropertyNode", | ||
"PayNode", | ||
"SendNode", | ||
"ResultNode", | ||
"ConfirmationNode", | ||
], | ||
}, | ||
SectionOne: { | ||
type: 360, | ||
data: { | ||
title: "Section 1", | ||
}, | ||
}, | ||
FindPropertyNode: { | ||
type: 9, | ||
}, | ||
ResultNode: { | ||
data: { | ||
flagSet: "Planning permission", | ||
overrides: { | ||
NO_APP_REQUIRED: { | ||
heading: "Congratulations!", | ||
}, | ||
}, | ||
}, | ||
type: 3, | ||
}, | ||
AnswerOne: { | ||
data: { | ||
text: "?", | ||
}, | ||
type: 200, | ||
}, | ||
QuestionInPortal: { | ||
data: { | ||
text: "internal question", | ||
}, | ||
type: 100, | ||
edges: ["AnswerInPortalOne", "AnswerInPortalTwo"], | ||
}, | ||
AnswerTwo: { | ||
data: { | ||
text: "!!", | ||
}, | ||
type: 200, | ||
}, | ||
InternalPortalNode: { | ||
data: { | ||
text: "portal", | ||
}, | ||
type: 300, | ||
edges: ["QuestionInPortal"], | ||
}, | ||
QuestionOne: { | ||
data: { | ||
text: "Question", | ||
}, | ||
type: 100, | ||
edges: ["AnswerOne", "AnswerTwo"], | ||
}, | ||
PayNode: { | ||
data: { | ||
fn: "application.fee.payable", | ||
url: "http://localhost:7002/pay", | ||
color: "#EFEFEF", | ||
title: "Pay for your application", | ||
description: | ||
'<p>The planning fee covers the cost of processing your application. Find out more about how planning fees are calculated <a href="https://www.gov.uk/guidance/fees-for-planning-applications" target="_self">here</a>.</p>', | ||
}, | ||
type: 400, | ||
}, | ||
AnswerInPortalOne: { | ||
data: { | ||
text: "?", | ||
}, | ||
type: 200, | ||
}, | ||
AnswerInPortalTwo: { | ||
data: { | ||
text: "*", | ||
}, | ||
type: 200, | ||
}, | ||
ConfirmationNode: { | ||
data: { | ||
heading: "Application sent", | ||
moreInfo: | ||
"<h2>You will be contacted</h2>\n<ul>\n<li>if there is anything missing from the information you have provided so far</li>\n<li>if any additional information is required</li>\n<li>to arrange a site visit, if required</li>\n<li>to inform you whether a certificate has been granted or not</li>\n</ul>\n", | ||
contactInfo: | ||
'<p>You can contact us at <a href="mailto:[email protected]" target="_self"><strong>[email protected]</strong></a></p>\n', | ||
description: | ||
"A payment receipt has been emailed to you. You will also receive an email to confirm when your application has been received.", | ||
feedbackCTA: "What did you think of this service? (takes 30 seconds)", | ||
}, | ||
type: 725, | ||
}, | ||
SendNode: { | ||
data: { | ||
url: "http://localhost:7002/bops/southwark", | ||
}, | ||
type: 650, | ||
}, | ||
}; |
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 |
---|---|---|
|
@@ -4,8 +4,9 @@ import { queryMock } from "../../../tests/graphqlQueryMock"; | |
import { authHeader, getJWT } from "../../../tests/mockJWT"; | ||
import app from "../../../server"; | ||
import { flowWithInviteToPay } from "../../../tests/mocks/inviteToPayData"; | ||
import { FlowGraph } from "@opensystemslab/planx-core/types"; | ||
import { userContext } from "../../auth/middleware"; | ||
import { FlowGraph } from "@opensystemslab/planx-core/types"; | ||
import { mockFlowData } from "../../../tests/mocks/validateAndPublishMocks"; | ||
|
||
beforeAll(() => { | ||
const getStoreMock = jest.spyOn(userContext, "getStore"); | ||
|
@@ -294,113 +295,3 @@ describe("invite to pay validation on diff", () => { | |
}); | ||
}); | ||
}); | ||
|
||
const mockFlowData: FlowGraph = { | ||
_root: { | ||
edges: [ | ||
"SectionOne", | ||
"QuestionOne", | ||
"InternalPortalNode", | ||
"FindPropertyNode", | ||
"PayNode", | ||
"SendNode", | ||
"ResultNode", | ||
"ConfirmationNode", | ||
], | ||
}, | ||
SectionOne: { | ||
type: 360, | ||
data: { | ||
title: "Section 1", | ||
}, | ||
}, | ||
FindPropertyNode: { | ||
type: 9, | ||
}, | ||
ResultNode: { | ||
data: { | ||
flagSet: "Planning permission", | ||
overrides: { | ||
NO_APP_REQUIRED: { | ||
heading: "Congratulations!", | ||
}, | ||
}, | ||
}, | ||
type: 3, | ||
}, | ||
AnswerOne: { | ||
data: { | ||
text: "?", | ||
}, | ||
type: 200, | ||
}, | ||
QuestionInPortal: { | ||
data: { | ||
text: "internal question", | ||
}, | ||
type: 100, | ||
edges: ["AnswerInPortalOne", "AnswerInPortalTwo"], | ||
}, | ||
AnswerTwo: { | ||
data: { | ||
text: "!!", | ||
}, | ||
type: 200, | ||
}, | ||
InternalPortalNode: { | ||
data: { | ||
text: "portal", | ||
}, | ||
type: 300, | ||
edges: ["QuestionInPortal"], | ||
}, | ||
QuestionOne: { | ||
data: { | ||
text: "Question", | ||
}, | ||
type: 100, | ||
edges: ["AnswerOne", "AnswerTwo"], | ||
}, | ||
PayNode: { | ||
data: { | ||
fn: "application.fee.payable", | ||
url: "http://localhost:7002/pay", | ||
color: "#EFEFEF", | ||
title: "Pay for your application", | ||
description: | ||
'<p>The planning fee covers the cost of processing your application. Find out more about how planning fees are calculated <a href="https://www.gov.uk/guidance/fees-for-planning-applications" target="_self">here</a>.</p>', | ||
}, | ||
type: 400, | ||
}, | ||
AnswerInPortalOne: { | ||
data: { | ||
text: "?", | ||
}, | ||
type: 200, | ||
}, | ||
AnswerInPortalTwo: { | ||
data: { | ||
text: "*", | ||
}, | ||
type: 200, | ||
}, | ||
ConfirmationNode: { | ||
data: { | ||
heading: "Application sent", | ||
moreInfo: | ||
"<h2>You will be contacted</h2>\n<ul>\n<li>if there is anything missing from the information you have provided so far</li>\n<li>if any additional information is required</li>\n<li>to arrange a site visit, if required</li>\n<li>to inform you whether a certificate has been granted or not</li>\n</ul>\n", | ||
contactInfo: | ||
'<p>You can contact us at <a href="mailto:[email protected]" target="_self"><strong>[email protected]</strong></a></p>\n', | ||
description: | ||
"A payment receipt has been emailed to you. You will also receive an email to confirm when your application has been received.", | ||
feedbackCTA: "What did you think of this service? (takes 30 seconds)", | ||
}, | ||
type: 725, | ||
}, | ||
SendNode: { | ||
data: { | ||
url: "http://localhost:7002/bops/southwark", | ||
}, | ||
type: 650, | ||
}, | ||
}; |
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,111 @@ | ||
import { FlowGraph } from "@opensystemslab/planx-core/types"; | ||
|
||
export const mockFlowData: FlowGraph = { | ||
_root: { | ||
edges: [ | ||
"SectionOne", | ||
"QuestionOne", | ||
"InternalPortalNode", | ||
"FindPropertyNode", | ||
"PayNode", | ||
"SendNode", | ||
"ResultNode", | ||
"ConfirmationNode", | ||
], | ||
}, | ||
SectionOne: { | ||
type: 360, | ||
data: { | ||
title: "Section 1", | ||
}, | ||
}, | ||
FindPropertyNode: { | ||
type: 9, | ||
}, | ||
ResultNode: { | ||
data: { | ||
flagSet: "Planning permission", | ||
overrides: { | ||
NO_APP_REQUIRED: { | ||
heading: "Congratulations!", | ||
}, | ||
}, | ||
}, | ||
type: 3, | ||
}, | ||
AnswerOne: { | ||
data: { | ||
text: "?", | ||
}, | ||
type: 200, | ||
}, | ||
QuestionInPortal: { | ||
data: { | ||
text: "internal question", | ||
}, | ||
type: 100, | ||
edges: ["AnswerInPortalOne", "AnswerInPortalTwo"], | ||
}, | ||
AnswerTwo: { | ||
data: { | ||
text: "!!", | ||
}, | ||
type: 200, | ||
}, | ||
InternalPortalNode: { | ||
data: { | ||
text: "portal", | ||
}, | ||
type: 300, | ||
edges: ["QuestionInPortal"], | ||
}, | ||
QuestionOne: { | ||
data: { | ||
text: "Question", | ||
}, | ||
type: 100, | ||
edges: ["AnswerOne", "AnswerTwo"], | ||
}, | ||
PayNode: { | ||
data: { | ||
fn: "application.fee.payable", | ||
url: "http://localhost:7002/pay", | ||
color: "#EFEFEF", | ||
title: "Pay for your application", | ||
description: | ||
'<p>The planning fee covers the cost of processing your application. Find out more about how planning fees are calculated <a href="https://www.gov.uk/guidance/fees-for-planning-applications" target="_self">here</a>.</p>', | ||
}, | ||
type: 400, | ||
}, | ||
AnswerInPortalOne: { | ||
data: { | ||
text: "?", | ||
}, | ||
type: 200, | ||
}, | ||
AnswerInPortalTwo: { | ||
data: { | ||
text: "*", | ||
}, | ||
type: 200, | ||
}, | ||
ConfirmationNode: { | ||
data: { | ||
heading: "Application sent", | ||
moreInfo: | ||
"<h2>You will be contacted</h2>\n<ul>\n<li>if there is anything missing from the information you have provided so far</li>\n<li>if any additional information is required</li>\n<li>to arrange a site visit, if required</li>\n<li>to inform you whether a certificate has been granted or not</li>\n</ul>\n", | ||
contactInfo: | ||
'<p>You can contact us at <a href="mailto:[email protected]" target="_self"><strong>[email protected]</strong></a></p>\n', | ||
description: | ||
"A payment receipt has been emailed to you. You will also receive an email to confirm when your application has been received.", | ||
feedbackCTA: "What did you think of this service? (takes 30 seconds)", | ||
}, | ||
type: 725, | ||
}, | ||
SendNode: { | ||
data: { | ||
url: "http://localhost:7002/bops/southwark", | ||
}, | ||
type: 650, | ||
}, | ||
}; |