Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

FS-4336: Fix form name for the HSRA question pages #548

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fsd_config/form_jsons/hsra_r1/hsra-r1-eligibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,5 +690,6 @@
"outputs": [],
"version": 2,
"skipSummary": false,
"markAsComplete": false
"markAsComplete": false,
"name": "Apply for funding to cover the cost of delivering a high street rental auction"
}
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ export class PageControllerBase {

viewModel.backLink =
state.callback?.returnUrl ?? progress[progress.length - 2];
if (state["metadata"]["has_eligibility"]) {
if (state["metadata"] && state["metadata"]["has_eligibility"]) {
viewModel.backLinkText = UtilHelper.getBackLinkText(
true,
this.model.def?.metadata?.isWelsh
Expand Down
12 changes: 4 additions & 8 deletions runner/test/cases/server/plugins/engine/NotifyViewModel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"metadata": {},
"metadata": { "has_eligibility": false },
"startPage": "/first-page",
"pages": [
{
Expand Down Expand Up @@ -104,8 +104,7 @@
"value": "aSection.caz==2"
}
],
"fees": [
],
"fees": [],
"outputs": [
{
"name": "notify",
Expand All @@ -118,10 +117,7 @@
"templateId": "some-template-id",
"emailField": "aSection.emailAddress",
"addReferencesToPersonalisation": true,
"personalisation": [
"aSection.name",
"nameIsJen"
],
"personalisation": ["aSection.name", "nameIsJen"],
"emailReplyToIdConfiguration": [
{
"emailReplyToId": "default-email-id"
Expand All @@ -135,6 +131,6 @@
}
],
"version": 2,
"payApiKey": {"test": "test_api_key", "production": "production_api_key"},
"payApiKey": { "test": "test_api_key", "production": "production_api_key" },
"skipSummary": false
}
2 changes: 1 addition & 1 deletion runner/test/cases/server/plugins/engine/SaveViewModel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"metadata": {},
"metadata": { "has_eligibility": false },
"startPage": "/first-page",
"pages": [
{
Expand Down
10 changes: 4 additions & 6 deletions runner/test/cases/server/plugins/engine/SummaryViewModel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"metadata": {},
"metadata": { "has_eligibility": false },
"startPage": "/first-page",
"pages": [
{
Expand Down Expand Up @@ -103,10 +103,8 @@
"title": "Named Section"
}
],
"conditions": [
],
"fees": [
],
"conditions": [],
"fees": [],
"outputs": [
{
"name": "webhook",
Expand All @@ -118,6 +116,6 @@
}
],
"version": 2,
"payApiKey": {"test": "test_api_key", "production": "production_api_key"},
"payApiKey": { "test": "test_api_key", "production": "production_api_key" },
"skipSummary": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ suite("WebhookModel", () => {
formModel
);
expect(parsed).to.equal({
metadata: {},
metadata: { has_eligibility: false },
name: "My Service",
questions: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"metadata": { "isWelsh": true },
"metadata": { "isWelsh": true, "has_eligibility": false },
"startPage": "/first-page",
"pages": [
{
Expand Down
2 changes: 1 addition & 1 deletion runner/test/cases/server/services/webhookService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ suite("Server WebhookService Service", () => {
const serverMock = { logger: loggerSpy };
const webHookeService = new WebhookService(serverMock);
const result = await webHookeService.postRequest("/url", {});
expect(result).to.equal("1234");
expect(result).to.equal({ reference: "1234" });
});

test("Webhook returns correct reference when payload is object", async () => {
Expand Down
Loading