Skip to content

Commit

Permalink
Merge pull request #1476 from alphagov/fix-link-colour
Browse files Browse the repository at this point in the history
Add classes to override invisible links
  • Loading branch information
injms authored Sep 10, 2019
2 parents bde736a + 547f3fb commit 5c37897
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/presenters/content_item/national_applicability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def applies_to
nations_with_alt_urls = inapplicable_nations.select { |n| n["alternative_url"].present? }
if nations_with_alt_urls.any?
alternate_links = nations_with_alt_urls
.map { |n| link_to(n['label'], n['alternative_url'], rel: :external) }
.map { |n| link_to(n['label'], n['alternative_url'], rel: :external, class: "govuk-link app-link") }
.to_sentence

applies_to += " (see #{translated_schema_name(nations_with_alt_urls.count)} for #{alternate_links})"
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/detailed_guide_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def schema_name
presented = presented_item('national_applicability_alternative_url_detailed_guide')

assert example['details'].include?('national_applicability')
assert_equal presented.applies_to, 'England, Scotland, and Wales (see guidance for <a rel="external" href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for">Northern Ireland</a>)'
assert_equal presented.applies_to, 'England, Scotland, and Wales (see guidance for <a rel="external" class="govuk-link app-link" href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for">Northern Ireland</a>)'
end

test 'context in title is overridden to display as guidance' do
Expand Down
2 changes: 1 addition & 1 deletion test/presenters/publication_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def schema_name
assert example['details'].include?('national_applicability')
assert_equal(
presented.applies_to,
'England (see publications for <a rel="external" href="http://www.dsdni.gov.uk/index/stats_and_research/stats-publications/stats-housing-publications/housing_stats.htm">Northern Ireland</a>, <a rel="external" href="http://www.scotland.gov.uk/Topics/Statistics/Browse/Housing-Regeneration/HSfS">Scotland</a>, and <a rel="external" href="http://wales.gov.uk/topics/statistics/headlines/housing2012/121025/?lang=en">Wales</a>)'
'England (see publications for <a rel="external" class="govuk-link app-link" href="http://www.dsdni.gov.uk/index/stats_and_research/stats-publications/stats-housing-publications/housing_stats.htm">Northern Ireland</a>, <a rel="external" class="govuk-link app-link" href="http://www.scotland.gov.uk/Topics/Statistics/Browse/Housing-Regeneration/HSfS">Scotland</a>, and <a rel="external" class="govuk-link app-link" href="http://wales.gov.uk/topics/statistics/headlines/housing2012/121025/?lang=en">Wales</a>)'
)
end
end

0 comments on commit 5c37897

Please sign in to comment.