diff --git a/app/views/case_logs/_tasklist.html.erb b/app/views/case_logs/_tasklist.html.erb index 3806758b6..e56fca38b 100644 --- a/app/views/case_logs/_tasklist.html.erb +++ b/app/views/case_logs/_tasklist.html.erb @@ -11,7 +11,7 @@
  • > <% first_page = @form.first_page_for_subsection(subsection_key) %> <%= link_to subsection_value["label"], send("case_log_#{first_page}_path", @case_log), class: "task-name govuk-link" %> - <% subsection_status=get_subsection_status(subsection_key, @case_log, @form.questions_for_subsection(subsection_key)) %> + <% subsection_status=get_subsection_status(subsection_key, @case_log, @form.questions_for_subsection(subsection_key).keys) %> <%= get_status_label(subsection_status) %> diff --git a/spec/features/case_log_spec.rb b/spec/features/case_log_spec.rb index d9863dcc4..76bcd72ed 100644 --- a/spec/features/case_log_spec.rb +++ b/spec/features/case_log_spec.rb @@ -52,6 +52,15 @@ RSpec.describe "Test Features" do assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1 end + it "shows the correct status if one section is completed" do + answer_all_questions_in_income_subsection + visit("/case_logs/#{empty_case_log.id}") + + assert_selector ".govuk-tag", text: /Not started/, count: 7 + assert_selector ".govuk-tag", text: /Completed/, count: 1 + assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1 + end + it "skips to the first section if no answers are completed" do visit("/case_logs/#{empty_case_log.id}") expect(page).to have_link("Skip to next incomplete section", :href => /#household_characteristics/)