Skip to content

Commit

Permalink
Merge branch 'main' into feature/3282/increase-search-threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons authored Oct 29, 2024
2 parents fe1902c + f350c1d commit ec3e187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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 @@ -529,6 +529,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

0 comments on commit ec3e187

Please sign in to comment.