citizensadvice / design-system

Citizens Advice Design System
https://citizens-advice-design-system.netlify.app/
Apache License 2.0
31 stars 7 forks source link

Aria label in footer feedback link is incorrect if the feedback_title arg isn't passed in #3508

Closed KPobeeNorris closed 3 weeks ago

KPobeeNorris commented 4 weeks ago

Summary of problem

We've recently been made aware of an issue with the aria-label in the footer feedback link being malformed if the feedback_title arg isn't passed through to the design system. If no feedback_title is passed in then the aria label is set to (opens in new tab).

In the footer html file there's an or statement that falls back to the default feedback title if the title is missing. But this behaviour isn't extended to/replicated in the aria-label in the ruby file, it just uses title, so it will be nil if the title hasn't been passed in.

Steps to replicate

Render the footer component without the feedback_title argument e.g.

= render FooterComponent.new(current_path: request.path, feedback_survey_id: "/some-feedback-url/", columns: advisernet_footer_nav_links)

Expected behaviour

The aria-label falls back to use the same feedback text as the title; if feedback_title is nil

Actual behavior

The aria-label is set to (opens in a new tab) if feedback_title isn't passed through

Context

This is a screenshot of the aria-label before the update to public-website: Screenshot 2024-10-15 at 08 21 23