Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lighthouse address input test #3405

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/autosuggest/autosuggest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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');

Expand Down
1 change: 1 addition & 0 deletions src/components/autosuggest/autosuggest.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down