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

Commit

Permalink
fix yarn tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NarenderRajuB committed Jun 10, 2024
1 parent a3a8c63 commit aec8ef7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 19 deletions.
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

0 comments on commit aec8ef7

Please sign in to comment.