Browse Source

Merge branch 'CLDC-3499-remove-pre-2025-tests' into CLDC-3676-remove-all-pre-2025-validations

pull/3329/head
Nat Dean-Lewis 4 days ago committed by GitHub
parent
commit
8c678392ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 14
      spec/components/check_answers_summary_list_card_component_spec.rb

14
spec/components/check_answers_summary_list_card_component_spec.rb

@ -1,6 +1,8 @@
require "rails_helper"
RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do
include CollectionTimeHelper
subject(:component) { described_class.new(questions:, log:, user:) }
let(:rendered) { render_inline(component) }
@ -64,4 +66,16 @@ RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do
expect(rendered).to have_link(log.form.get_question("tenancycode", log).check_answer_prompt, href: "/lettings-logs/#{log.id}/tenant-code?referrer=check_answers_new_answer", class: "govuk-link govuk-link--no-visited-state")
end
end
context "when a log is from an archived collection year" do
context "when given a set of questions" do
let(:log) { create(:lettings_log, :completed, :ignore_validation_errors, age2: 99, startdate: archived_collection_start_date, assigned_to: create(:user)) }
it "renders a summary list card without question numbers for the answers to those questions" do
expect(rendered).to have_content(questions.first.answer_label(log))
expect(rendered).to have_content("Lead tenant’s age")
expect(rendered).not_to include(" - Lead tenant’s age")
end
end
end
end

Loading…
Cancel
Save