From ddb22a0fc9640622b58f9e8e7fe1cd32e9c9c33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Rodr=C3=ADguez=20Carmona?= Date: Mon, 14 Jul 2025 14:11:46 +0200 Subject: [PATCH 1/3] OEL-2127: When there is no aria-label attribute for close button, we add a visually-hidden element inside button. --- .../bcl-offcanvas/offcanvas.html.twig | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/bcl-offcanvas/offcanvas.html.twig b/src/components/bcl-offcanvas/offcanvas.html.twig index 0b657ad05..ce4d42030 100644 --- a/src/components/bcl-offcanvas/offcanvas.html.twig +++ b/src/components/bcl-offcanvas/offcanvas.html.twig @@ -31,6 +31,7 @@ {% set _with_backdrop = with_backdrop ?? true %} {% set _with_close = with_close ?? true %} {% set _close_aria_label = close_aria_label|default('') %} +{% set _close_content = '' %} {% set _extra_classes_body = extra_classes_body|default('') %} {% set _extra_classes_header = extra_classes_header|default('') %} {% set _extra_classes_close = extra_classes_close|default('') %} @@ -89,18 +90,28 @@ } only %} {% endif %} {% if _with_close %} - {% set button_attributes = create_attribute() + {% set _close_attributes = create_attribute() .addClass(['btn-close', 'text-reset']) .setAttribute('data-bs-dismiss', 'offcanvas') .setAttribute('data-bs-target', '#' ~ _id) - .setAttribute('aria-label', _close_aria_label) %} + {% if _extra_classes_close is not empty %} - {% set button_attributes = button_attributes.addClass(_extra_classes_close) %} + {% set _close_attributes = _close_attributes.addClass(_extra_classes_close) %} + {% endif %} + + {% if _close_aria_label %} + {% set _close_attributes = _close_attributes.setAttribute('aria-label', _close_aria_label) %} + {% else %} + {% set _close_content %} + {{ "Close" }} + {% endset %} {% endif %} + {%- include '@oe-bcl/bcl-button/button.html.twig' with { - attributes: button_attributes, - clean_class: true + 'label': _close_content, + 'attributes': _close_attributes, + 'clean_class': true } only -%} {% endif %} From 395b5509ffa8287a1f694bf1b6391a6b8b753c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Rodr=C3=ADguez=20Carmona?= Date: Mon, 14 Jul 2025 14:13:28 +0200 Subject: [PATCH 2/3] OEL-2127: Fix broken test due to changes in markup for offcanvas when there is no aria label in close button. --- .../bcl-group/__snapshots__/group.test.js.snap | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/compositions/bcl-group/__snapshots__/group.test.js.snap b/src/compositions/bcl-group/__snapshots__/group.test.js.snap index 09055ac7c..85acc5bb3 100644 --- a/src/compositions/bcl-group/__snapshots__/group.test.js.snap +++ b/src/compositions/bcl-group/__snapshots__/group.test.js.snap @@ -2808,12 +2808,17 @@ exports[`OE - Group listing Content renders correctly 1`] = ` Filter options
Date: Mon, 14 Jul 2025 14:19:55 +0200 Subject: [PATCH 3/3] OEL-2127: Increasing timeout for some tests failing due to default timeout. --- src/compositions/bcl-page/page.test.js | 2 +- src/compositions/bcl-search/search.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compositions/bcl-page/page.test.js b/src/compositions/bcl-page/page.test.js index fcf34304c..ff43ccc1e 100644 --- a/src/compositions/bcl-page/page.test.js +++ b/src/compositions/bcl-page/page.test.js @@ -22,5 +22,5 @@ describe("OE - Page", () => { expect( await axe(renderTwigFileAsHtml(template, demoData)), ).toHaveNoViolations(); - }); + }, 10000); }); diff --git a/src/compositions/bcl-search/search.test.js b/src/compositions/bcl-search/search.test.js index ac8eb9591..7d341101c 100644 --- a/src/compositions/bcl-search/search.test.js +++ b/src/compositions/bcl-search/search.test.js @@ -22,5 +22,5 @@ describe("OE - Search", () => { expect( await axe(renderTwigFileAsHtml(template, dataListing)), ).toHaveNoViolations(); - }); + }, 10000); });