Skip to content

Commit

Permalink
Improve back to top link validation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Mar 4, 2025
1 parent c16cbf8 commit b764c07
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<%
add_gem_component_stylesheet("back-to-top")

text ||= t('content_item.contents', default: "Contents")

if href.blank? || text.blank?
raise ArgumentError, "The back_to_top component requires text and a href"
end

component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
component_helper.add_class("govuk-link gem-c-back-to-top govuk-!-display-none-print")
%>
Expand Down

0 comments on commit b764c07

Please sign in to comment.