fix: #3622966 Give the header Newsletter button a link destination

Issue: https://www.drupal.org/i/3622966

The header Newsletter button did nothing when clicked. The button component placement in config/canvas.page_region.vartheme_bs5_rightup.header.yml carried a label but no href, so the SDC rendered a bare <button> element with no destination.

      size: btn-sm
      label: Newsletter
+     href: /newsletter
      target: self

The destination already ships with this recipe — the Newsletter Canvas page at content/canvas_page/10-newsletter.yml, served at /newsletter, which the two Newsletter menu links already pointed at correctly. Only the header call-to-action button did not.

Same class of defect as the Horizon Aid footer Subscribe button, https://www.drupal.org/i/3622817.

Functional test coverage

Adds tests/features/01-website-base-requirements/01-08-header-newsletter-call-to-action.feature to the Varbase functional testing suite — six scenarios:

  • the header Newsletter button carries a link to /newsletter;
  • clicking it opens the Newsletter page and the page shows its heading;
  • the destination still holds on the Studios, Podcasts, About Us and Contact Us pages.

Proven against both states, rather than only against the fix:

Site Result
built from this branch 6 scenarios pass, 27 steps
built from the unfixed recipe 6 scenarios fail

The failure on the unfixed recipe is the defect itself:

AssertionError: Expected element href to contain "/newsletter" but got ""

A dry run over the whole suite reports zero undefined and zero ambiguous steps.

One note for reviewers on the selector: the feature addresses the button as ".btn-accent" rather than "header a.btn-accent". The suite's selector builder passes a selector through verbatim only when it has no space; a selector containing one is rewritten into an [value=…] union and silently matches nothing. .btn-accent resolves to the header button, which precedes page content in the document.

Verified

ddev composer create-project drupal/cms
ddev composer config minimum-stability dev
ddev composer require drupal/rightup:1.0.x-dev
ddev drush si -y ../recipes/rightup

Before: <button class="btn btn-accent btn-sm ...">Newsletter</button> — no href. After: <a href="/newsletter">Newsletter</a>.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading
Loading