From 0443f5319951ed9d72e1718195e3d164dc615353 Mon Sep 17 00:00:00 2001 From: Simon Boyd Date: Wed, 6 Nov 2024 14:06:44 +0000 Subject: [PATCH 1/2] Fix error message placement in Psc Type page --- src/views/router_views/psc_type/psc_type.njk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/router_views/psc_type/psc_type.njk b/src/views/router_views/psc_type/psc_type.njk index 7edba03e..6d2c174a 100644 --- a/src/views/router_views/psc_type/psc_type.njk +++ b/src/views/router_views/psc_type/psc_type.njk @@ -10,8 +10,7 @@
{% include "includes/csrf_token.njk" %} -
- {{ govukRadios({ + {{ govukRadios({ idPrefix: "pscType", name: "pscType", value: pscType, @@ -22,7 +21,9 @@ classes: "govuk-fieldset__legend--l" } }, - errorMessage: errors.pscType.inline if errors.pscType, + errorMessage: { + text: errors.pscType.inline + } if errors.pscType, items: [ { value: "individual", @@ -45,7 +46,6 @@ ] }) }} -
{{ govukDetails({ summaryText: i18n.psc_type_details_title, From cbe7e5c1bb36b80993b4e2b7d7f5a3c633440108 Mon Sep 17 00:00:00 2001 From: Simon Boyd Date: Wed, 6 Nov 2024 14:40:54 +0000 Subject: [PATCH 2/2] Fix missing export from pscVerification.mock --- .../handlers/individual-psc-list/individualPscList.unit.ts | 6 +++--- test/routers/handlers/psc-type/pscType.int.ts | 4 ++-- test/routers/pscTypeRouter.int.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/routers/handlers/individual-psc-list/individualPscList.unit.ts b/test/routers/handlers/individual-psc-list/individualPscList.unit.ts index d615b115..81d1f21c 100644 --- a/test/routers/handlers/individual-psc-list/individualPscList.unit.ts +++ b/test/routers/handlers/individual-psc-list/individualPscList.unit.ts @@ -1,5 +1,5 @@ import { HttpStatusCode } from "axios"; -import { COMPANY_NUMBER, CREATED_RESOURCE, PSC_VERIFICATION_ID, TRANSACTION_ID } from "../../../mocks/pscVerification.mock"; +import { COMPANY_NUMBER, INDIVIDUAL_VERIFICATION_CREATED, PSC_VERIFICATION_ID, TRANSACTION_ID } from "../../../mocks/pscVerification.mock"; import { VALID_COMPANY_PSC_ITEMS } from "../../../mocks/companyPsc.mock"; import { getCompanyProfile } from "../../../../src/services/companyProfileService"; import { getPscVerification } from "../../../../src/services/pscVerificationService"; @@ -13,7 +13,7 @@ jest.mock("../../../../src/services/pscVerificationService"); const mockGetPscVerification = getPscVerification as jest.Mock; mockGetPscVerification.mockResolvedValueOnce({ httpStatusCode: HttpStatusCode.Ok, - resource: CREATED_RESOURCE + resource: INDIVIDUAL_VERIFICATION_CREATED }); jest.mock("../../../../src/services/companyProfileService"); @@ -45,7 +45,7 @@ describe("psc type handler", () => { } }); - const res = httpMocks.createResponse({ locals: { submission: CREATED_RESOURCE } }); + const res = httpMocks.createResponse({ locals: { submission: INDIVIDUAL_VERIFICATION_CREATED } }); const handler = new IndividualPscListHandler(); const { templatePath, viewData } = await handler.executeGet(req, res); diff --git a/test/routers/handlers/psc-type/pscType.int.ts b/test/routers/handlers/psc-type/pscType.int.ts index f9687f86..9ae24bb1 100644 --- a/test/routers/handlers/psc-type/pscType.int.ts +++ b/test/routers/handlers/psc-type/pscType.int.ts @@ -5,14 +5,14 @@ import middlewareMocks from "../../../mocks/allMiddleware.mock"; import app from "../../../../src/app"; import { PrefixedUrls } from "../../../../src/constants"; import { getUrlWithTransactionIdAndSubmissionId } from "../../../../src/utils/url"; -import { CREATED_RESOURCE, PSC_VERIFICATION_ID, TRANSACTION_ID } from "../../../mocks/pscVerification.mock"; +import { INDIVIDUAL_VERIFICATION_CREATED, PSC_VERIFICATION_ID, TRANSACTION_ID } from "../../../mocks/pscVerification.mock"; import { getPscVerification } from "../../../../src/services/pscVerificationService"; import { URLSearchParams } from "url"; jest.mock("../../../../src/services/pscVerificationService", () => ({ getPscVerification: () => ({ httpStatusCode: HttpStatusCode.Ok, - resource: CREATED_RESOURCE + resource: INDIVIDUAL_VERIFICATION_CREATED }) })); diff --git a/test/routers/pscTypeRouter.int.ts b/test/routers/pscTypeRouter.int.ts index 8b0b83a9..943f1746 100644 --- a/test/routers/pscTypeRouter.int.ts +++ b/test/routers/pscTypeRouter.int.ts @@ -2,7 +2,7 @@ import middlewareMocks from "../mocks/allMiddleware.mock"; import request from "supertest"; import { PrefixedUrls } from "../../src/constants"; import app from "../../src/app"; -import { COMPANY_NUMBER, CREATED_RESOURCE, PSC_VERIFICATION_ID, TRANSACTION_ID } from "../mocks/pscVerification.mock"; +import { COMPANY_NUMBER, INDIVIDUAL_VERIFICATION_CREATED, PSC_VERIFICATION_ID, TRANSACTION_ID } from "../mocks/pscVerification.mock"; import { HttpStatusCode } from "axios"; import { getUrlWithTransactionIdAndSubmissionId } from "../../src/utils/url"; import { getPscVerification } from "../../src/services/pscVerificationService"; @@ -10,7 +10,7 @@ import { getPscVerification } from "../../src/services/pscVerificationService"; jest.mock("../../src/services/pscVerificationService", () => ({ getPscVerification: () => ({ httpStatusCode: HttpStatusCode.Ok, - resource: CREATED_RESOURCE + resource: INDIVIDUAL_VERIFICATION_CREATED }) }));