From b102260384b10cfcc4ae1cbb2ee861dfef652c18 Mon Sep 17 00:00:00 2001 From: Daniel Clarke Date: Wed, 7 Aug 2024 09:27:13 +0100 Subject: [PATCH] Changed view to show confirmation statement in place of the question text --- .../Content/MockContentfulService.cs | 4 ++-- .../Controllers/QualificationDetailsController.cs | 3 ++- .../Models/Content/AdditionalRequirementAnswerModel.cs | 2 ++ .../Views/QualificationDetails/Index.cshtml | 2 +- .../cypress/e2e/pages/qualification-details-spec.cy.js | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Dfe.EarlyYearsQualification.Mock/Content/MockContentfulService.cs b/src/Dfe.EarlyYearsQualification.Mock/Content/MockContentfulService.cs index 5b545fc6..234dfde8 100644 --- a/src/Dfe.EarlyYearsQualification.Mock/Content/MockContentfulService.cs +++ b/src/Dfe.EarlyYearsQualification.Mock/Content/MockContentfulService.cs @@ -208,7 +208,7 @@ public async Task> GetNavigationLinks() } ], ConfirmationStatement = - "This is the confirmation statement", + "This is the confirmation statement 1", AnswerToBeFullAndRelevant = true }, new() @@ -234,7 +234,7 @@ public async Task> GetNavigationLinks() } ], ConfirmationStatement = - "This is the confirmation statement", + "This is the confirmation statement 2", AnswerToBeFullAndRelevant = true } }, diff --git a/src/Dfe.EarlyYearsQualification.Web/Controllers/QualificationDetailsController.cs b/src/Dfe.EarlyYearsQualification.Web/Controllers/QualificationDetailsController.cs index 4cd31b71..b0c91ab5 100644 --- a/src/Dfe.EarlyYearsQualification.Web/Controllers/QualificationDetailsController.cs +++ b/src/Dfe.EarlyYearsQualification.Web/Controllers/QualificationDetailsController.cs @@ -361,7 +361,8 @@ await govUkInsetTextRenderer.ToHtml(content.CheckAnotherQualificationText), var answerToAdd = new AdditionalRequirementAnswerModel { Question = additionalRequirementQuestion.Question, - AnswerToBeFullAndRelevant = additionalRequirementQuestion.AnswerToBeFullAndRelevant + AnswerToBeFullAndRelevant = additionalRequirementQuestion.AnswerToBeFullAndRelevant, + ConfirmationStatement = additionalRequirementQuestion.ConfirmationStatement }; if (additionalRequirementsAnswers.TryGetValue(additionalRequirementQuestion.Question, out var answer)) diff --git a/src/Dfe.EarlyYearsQualification.Web/Models/Content/AdditionalRequirementAnswerModel.cs b/src/Dfe.EarlyYearsQualification.Web/Models/Content/AdditionalRequirementAnswerModel.cs index 9138d378..cb5615c0 100644 --- a/src/Dfe.EarlyYearsQualification.Web/Models/Content/AdditionalRequirementAnswerModel.cs +++ b/src/Dfe.EarlyYearsQualification.Web/Models/Content/AdditionalRequirementAnswerModel.cs @@ -7,4 +7,6 @@ public class AdditionalRequirementAnswerModel public string? Answer { get; set; } = string.Empty; public bool AnswerToBeFullAndRelevant { get; init; } + + public string? ConfirmationStatement { get; init; } = string.Empty; } \ No newline at end of file diff --git a/src/Dfe.EarlyYearsQualification.Web/Views/QualificationDetails/Index.cshtml b/src/Dfe.EarlyYearsQualification.Web/Views/QualificationDetails/Index.cshtml index 914187d7..1c9b210b 100644 --- a/src/Dfe.EarlyYearsQualification.Web/Views/QualificationDetails/Index.cshtml +++ b/src/Dfe.EarlyYearsQualification.Web/Views/QualificationDetails/Index.cshtml @@ -56,7 +56,7 @@ {
- @Model.AdditionalRequirementAnswers[count].Question + @Model.AdditionalRequirementAnswers[count].ConfirmationStatement
@CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.AdditionalRequirementAnswers[count].Answer!.ToLower()) diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js index 1549a9ee..c15bb86b 100644 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js @@ -22,9 +22,9 @@ describe("A spec used to test the qualification details page", () => { cy.get("#from-which-year-value").should("contain.text", "2020"); // Check that the additional requirements and the answers are present - cy.get("#additional-requirement-0-label").should("contain.text", "Test question"); + cy.get("#additional-requirement-0-label").should("contain.text", "This is the confirmation statement 1"); cy.get("#additional-requirement-0-value").should("contain.text", "Yes"); - cy.get("#additional-requirement-1-label").should("contain.text", "Test question 2"); + cy.get("#additional-requirement-1-label").should("contain.text", "This is the confirmation statement 2"); cy.get("#additional-requirement-1-value").should("contain.text", "Yes"); cy.get("#date-of-check-label").should("contain.text", "Test Date Of Check Label");