From 8eee37536e7468f0b10a0fc98635044ba3ba9f86 Mon Sep 17 00:00:00 2001 From: Richard Pattinson Date: Wed, 25 Sep 2024 15:09:21 +0100 Subject: [PATCH] Add Course start date to qualification summary component --- .../check_records/qualification_summary_component.rb | 8 ++++++++ .../check_records/qualification_summary_component_spec.rb | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/components/check_records/qualification_summary_component.rb b/app/components/check_records/qualification_summary_component.rb index 5b21f2c7..ff2a3694 100644 --- a/app/components/check_records/qualification_summary_component.rb +++ b/app/components/check_records/qualification_summary_component.rb @@ -58,6 +58,14 @@ def itt_rows } }, { key: { text: "Age range" }, value: { text: details.age_range&.description } }, + { + key: { + text: "Course start date" + }, + value: { + text: details.start_date&.to_date&.to_fs(:long_uk) + } + }, { key: { text: "Course end date" diff --git a/spec/components/check_records/qualification_summary_component_spec.rb b/spec/components/check_records/qualification_summary_component_spec.rb index 73e877e5..df180482 100644 --- a/spec/components/check_records/qualification_summary_component_spec.rb +++ b/spec/components/check_records/qualification_summary_component_spec.rb @@ -45,12 +45,16 @@ expect(rows[4].text).to include(qualification.details.age_range&.description) end + it "renders the qualification status" do + expect(rows[5].text).to include(Date.parse(qualification.details.start_date).to_fs(:long_uk)) + end + it "renders the qualification course end date" do - expect(rows[5].text).to include(Date.parse(qualification.details.end_date).to_fs(:long_uk)) + expect(rows[6].text).to include(Date.parse(qualification.details.end_date).to_fs(:long_uk)) end it "renders the qualification status" do - expect(rows[6].text).to include(qualification.details.result) + expect(rows[7].text).to include(qualification.details.result) end it "omits rows with no value" do