diff --git a/frontend/packages/akr/src/components/publicTranslator/filters/PublicTranslatorFilters.tsx b/frontend/packages/akr/src/components/publicTranslator/filters/PublicTranslatorFilters.tsx index c6596b281b..f85f3397df 100644 --- a/frontend/packages/akr/src/components/publicTranslator/filters/PublicTranslatorFilters.tsx +++ b/frontend/packages/akr/src/components/publicTranslator/filters/PublicTranslatorFilters.tsx @@ -283,7 +283,6 @@ export const PublicTranslatorFilters = ({ diff --git a/frontend/packages/akr/src/tests/cypress/support/page-objects/publicTranslatorFilters.ts b/frontend/packages/akr/src/tests/cypress/support/page-objects/publicTranslatorFilters.ts index 482d37be8a..c0778d55bb 100644 --- a/frontend/packages/akr/src/tests/cypress/support/page-objects/publicTranslatorFilters.ts +++ b/frontend/packages/akr/src/tests/cypress/support/page-objects/publicTranslatorFilters.ts @@ -7,18 +7,8 @@ class PublicTranslatorFilters { elements = { fromLangComboBox: () => cy.findByTestId('public-translator-filters__from-language-select'), - fromLangNativeSelect: () => - cy - .findByTestId('public-translator-filters__filter__language-pair') - .findAllByRole('combobox') - .first(), toLangComboBox: () => cy.findByTestId('public-translator-filters__to-language-select'), - toLangNativeSelect: () => - cy - .findByTestId('public-translator-filters__filter__language-pair') - .findAllByRole('combobox') - .last(), name: () => cy.findByTestId('public-translator-filters__name-field'), town: () => cy.findByTestId('public-translator-filters__town-combobox'), empty: () => cy.findByTestId('public-translator-filters__empty-btn'), @@ -32,7 +22,7 @@ class PublicTranslatorFilters { selectFromLangByName(isPhone: boolean, from: string) { if (isPhone) { - this.elements.fromLangNativeSelect().select(from); + this.elements.fromLangComboBox().findByRole('combobox').select(from); } else { this.clickFromLang(); this.selectOptionByName(from); @@ -41,7 +31,7 @@ class PublicTranslatorFilters { selectToLangByName(isPhone: boolean, to: string) { if (isPhone) { - this.elements.toLangNativeSelect().select(to); + this.elements.toLangComboBox().findByRole('combobox').select(to); } else { this.clickToLang(); this.selectOptionByName(to); diff --git a/frontend/packages/shared/src/components/LanguageSelect/LanguageSelect.tsx b/frontend/packages/shared/src/components/LanguageSelect/LanguageSelect.tsx index 157f652882..d4b5ef62fd 100644 --- a/frontend/packages/shared/src/components/LanguageSelect/LanguageSelect.tsx +++ b/frontend/packages/shared/src/components/LanguageSelect/LanguageSelect.tsx @@ -81,6 +81,7 @@ export const LanguageSelect = ({ value, helperText, showError, + 'data-testid': rest['data-testid'], }; for (const prop in rest) { if (prop in nativeSelectProps) { diff --git a/frontend/packages/shared/src/components/NativeSelect/NativeSelect.tsx b/frontend/packages/shared/src/components/NativeSelect/NativeSelect.tsx index 3b67cd6c70..2eb42ead7c 100644 --- a/frontend/packages/shared/src/components/NativeSelect/NativeSelect.tsx +++ b/frontend/packages/shared/src/components/NativeSelect/NativeSelect.tsx @@ -11,6 +11,7 @@ import { ComboBoxOption } from '../../interfaces'; import { Text } from '../Text/Text'; export interface CustomNativeSelectProps extends SelectProps { + 'data-testid'?: string; helperText?: string; showError?: boolean; placeholder: string; @@ -61,7 +62,7 @@ export const NativeSelectWithLabel: FC< const errorStyles = showError ? { color: 'error.main' } : {}; return ( - +