Skip to content

Commit

Permalink
add test for language
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons committed Nov 11, 2024
1 parent b79c1d8 commit 1d56aad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/autosuggest/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ describe('FOR: Macro: Autosuggest', () => {
expect($('.ons-autosuggest').attr('data-result-threshold')).toBe('0.5');
});

test('THEN: it has language set to "en-gb"', () => {
expect($('.ons-autosuggest').attr('data-lang')).toBe('en-gb');
});

test('THEN: it has the expected id on the results title element', () => {
expect($('.ons-autosuggest__results-title').attr('id')).toBe('country-of-birth-suggestions');
});
Expand Down
1 change: 1 addition & 0 deletions src/components/autosuggest/_test-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const EXAMPLE_AUTOSUGGEST = {
autosuggestData: '/examples/data/country-of-birth.json',
noResults: 'No suggestions found. You can enter your own answer',
typeMore: 'Continue entering to get suggestions',
language: 'en-gb',
};

export const EXAMPLE_AUTOSUGGEST_WITH_RESULTS_THRESHOLD = {
Expand Down

0 comments on commit 1d56aad

Please sign in to comment.