Browse Source

another fix

pull/673/head
JG 3 years ago
parent
commit
fd4d8612d1
  1. 7
      spec/components/search_result_caption_component_spec.rb

7
spec/components/search_result_caption_component_spec.rb

@ -11,14 +11,15 @@ RSpec.describe SearchResultCaptionComponent, type: :component do
it "all of the nav tabs specified in the items hash are passed to it" do it "all of the nav tabs specified in the items hash are passed to it" do
result = render_inline(described_class.new(searched:, count:, item_label:, total_count:, item:, path:)) result = render_inline(described_class.new(searched:, count:, item_label:, total_count:, item:, path:))
expect(result.to_html).to eq(" <span class=\"govuk-!-margin-right-4\">\n <strong>#{count}</strong> #{item_label} found matching '#{searched}' of <strong>#{total_count}</strong> total #{item}. <a class=\"govuk-link\" href=\"path\">Clear search</a>\n</span>\n") expect(result.to_html).to eq(" <span class=\"govuk-!-margin-right-4\">\n <strong>#{count}</strong> #{item_label} found matching #{searched} of <strong>#{total_count}</strong> total #{item}. <a class=\"govuk-link\" href=\"path\">Clear search</a>\n</span>\n")
end end
context "when no search results are found" do context "when no search results are found" do
let(:searched) { nil } let(:searched) { nil }
it "all of the nav tabs specified in the items hash are passed to it" do it "all of the nav tabs specified in the items hash are passed to it" do
result = render_inline(described_class.new(searched:, count:, item_label:, total_count:, item:, path:)) result = render_inline(described_class.new(searched:, count:, item_label:, total_count:, item:, path:))
expect(result.to_html).to eq(" <span class=\"govuk-!-margin-right-4\">\n <strong>#{count}</strong> #{item_label} found matching '#{searched}' of <strong>#{total_count}</strong> total #{item}. <a class=\"govuk-link\" href=\"path\">Clear search</a>\n</span>\n")
expect(result.to_html).to eq(" <span class=\"govuk-!-margin-right-4\">\n <strong>#{count}</strong> total #{item}.\n</span>\n")
end end
end end
end end

Loading…
Cancel
Save