From 7a9d131831cc1a98b7c7c7eefacdc25f43b90f61 Mon Sep 17 00:00:00 2001 From: Peter Rushforth Date: Mon, 24 Aug 2026 20:26:45 -0400 Subject: [PATCH] fix: add localized tooltip and aria-label to attribution summary The disclosure in the attribution control had no accessible name or hover tooltip. Set title and aria-label to locale.btnAttribution so the info button is labelled consistently across languages, mirroring the container's aria-label. Add e2e test verifying the summary's title and aria-label. --- src/mapml/control/AttributionButton.js | 2 +- test/e2e/mapml-viewer/mapml-viewer.test.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mapml/control/AttributionButton.js b/src/mapml/control/AttributionButton.js index 5b0959267..108286873 100644 --- a/src/mapml/control/AttributionButton.js +++ b/src/mapml/control/AttributionButton.js @@ -60,7 +60,7 @@ export var AttributionButton = Control.Attribution.extend({ } let locale = this._getLocale(); this._container.innerHTML = - `` + + `` + '
' + ` | ` + prefixAndAttribs.join(' ') + diff --git a/test/e2e/mapml-viewer/mapml-viewer.test.js b/test/e2e/mapml-viewer/mapml-viewer.test.js index 836ad888e..d330befae 100644 --- a/test/e2e/mapml-viewer/mapml-viewer.test.js +++ b/test/e2e/mapml-viewer/mapml-viewer.test.js @@ -54,6 +54,17 @@ test.describe('Playwright mapml-viewer Element Tests', () => { expect(arialabel).toEqual('Map data attribution'); }); + test('Ensure attribution summary has a localized title tooltip', async () => { + let title = await page.evaluate( + `document.querySelector('mapml-viewer')._map.attributionControl._container.querySelector('summary').getAttribute('title')` + ); + expect(title).toEqual('Map data attribution'); + let arialabel = await page.evaluate( + `document.querySelector('mapml-viewer')._map.attributionControl._container.querySelector('summary').getAttribute('aria-label')` + ); + expect(arialabel).toEqual('Map data attribution'); + }); + test('Initial map element extent', async () => { await page.waitForTimeout(500); const extent = await page.$eval('body > mapml-viewer', (map) => map.extent);