Skip to content

Commit

Permalink
Merge pull request #163 from companieshouse/lp-456-fix-name-ending
Browse files Browse the repository at this point in the history
LP-456 Fix name ending on check your answers page
  • Loading branch information
markpit authored Jan 28, 2025
2 parents 839de13 + c536e04 commit 7ef9200
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe("Check Your Answers Page", () => {

expect(res.status).toBe(200);
expect(res.text).toContain(limitedPartnership?.data?.partnership_name);
expect(res.text).toContain(limitedPartnership?.data?.name_ending);
expect(res.text).toContain(limitedPartnership?.data?.email);
expect(res.text).toContain("name#partnership_name");
expect(res.text).toContain("email#email");
Expand Down
41 changes: 24 additions & 17 deletions src/views/check-your-answers.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
{% set checkYourAnswers = "check-your-answers" %}
{% set currentUrl = props.currentUrl %}

{% set fullName = props.data.limitedPartnership.data.partnership_name %}
{% if props.data.limitedPartnership.data.name_ending %}
{% set fullName = fullName + " " + props.data.limitedPartnership.data.name_ending %}
{% endif %}

{% block content %}

<div class="govuk-grid-row">
Expand All @@ -16,20 +21,22 @@
rows: [
{
key: {
text: i18n.checkYourAnswersPage.headingName
},
value: {
text: props.data.limitedPartnership.data.partnership_name
},
actions: {
items: [ CREATE_CHANGE_LINK(
i18n.checkYourAnswersPage.change,
currentUrl | replace(checkYourAnswers, "name#partnership_name"),
partnershipNameChangeText,
"change-partnership-name-button"
) ]
}
},
text: i18n.checkYourAnswersPage.headingName
},
value: {
text: fullName
},
actions: {
items: [
CREATE_CHANGE_LINK(
i18n.checkYourAnswersPage.change,
currentUrl | replace(checkYourAnswers, "name#partnership_name"),
partnershipNameChangeText,
"change-partnership-name-button"
)
]
}
},
{
key: {
text: i18n.checkYourAnswersPage.headingSic
Expand All @@ -49,10 +56,10 @@
},
{
key: {
text: i18n.checkYourAnswersPage.headingEmail
text: i18n.checkYourAnswersPage.headingEmail
},
value: {
text: props.data.limitedPartnership.data.email
text: props.data.limitedPartnership.data.email
},
actions: {
items: [ CREATE_CHANGE_LINK(
Expand Down Expand Up @@ -121,4 +128,4 @@
</div>
</div>

{% endblock %}
{% endblock %}

0 comments on commit 7ef9200

Please sign in to comment.