From 75a23ea3727597ea8c459fc652f3e52a2a4373b0 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Thu, 24 Oct 2024 15:44:28 +0100 Subject: [PATCH 1/2] fix lighthouse address input error --- src/components/autosuggest/autosuggest.ui.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/autosuggest/autosuggest.ui.js b/src/components/autosuggest/autosuggest.ui.js index c91c7b826f..1a19883df5 100644 --- a/src/components/autosuggest/autosuggest.ui.js +++ b/src/components/autosuggest/autosuggest.ui.js @@ -511,6 +511,7 @@ export default class AutosuggestUI { const warningSpanElement = document.createElement('span'); const warningBodyElement = document.createElement('div'); + warningContainer.id = this.listbox.getAttribute('id'); warningContainer.className = 'ons-autosuggest__warning'; warningElement.className = 'ons-panel ons-panel--warn ons-autosuggest__panel'; From a81ff32a2542feb04c5fdc8890c6f087955ef7e7 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Thu, 24 Oct 2024 16:33:02 +0100 Subject: [PATCH 2/2] add test --- src/components/autosuggest/autosuggest.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/autosuggest/autosuggest.spec.js b/src/components/autosuggest/autosuggest.spec.js index 7948fd4a71..b7525f6eb0 100644 --- a/src/components/autosuggest/autosuggest.spec.js +++ b/src/components/autosuggest/autosuggest.spec.js @@ -609,6 +609,8 @@ describe('script: autosuggest', () => { expect(resultsItemCount).toBe(1); const warningText = await page.$eval('.ons-autosuggest__warning', (node) => node.textContent); expect(warningText.trim()).toBe('!Sorry, there is a problem.'); + const warningContainer = await page.$eval('.ons-autosuggest__warning', (node) => node.id); + expect(warningContainer).toBe('country-of-birth-listbox'); }); it('the list and results element should be removed from the page', async () => { @@ -657,7 +659,7 @@ describe('script: autosuggest', () => { await page.type('.ons-js-autosuggest-input', 'England', { delay: 20 }); await page.keyboard.press('ArrowUp'); await page.keyboard.press('Enter'); - // Defocus the autosuggest input. + // Unfocus the autosuggest input await page.keyboard.press('Tab'); await page.focus('.ons-js-autosuggest-input');