Skip to content
Snippets Groups Projects
Commit 523bb047 authored by chrisgarrity's avatar chrisgarrity
Browse files

move aria label onto languageSelector

parent 86a8dd36
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,9 @@ import styles from './language-selector.css';
// supported languages to exclude from the menu, but allow as a URL option
const ignore = ['he'];
const LanguageSelector = ({currentLocale, onChange}) => (
const LanguageSelector = ({currentLocale, label, onChange}) => (
<select
aria-label={label}
className={styles.languageSelect}
value={currentLocale}
onChange={onChange}
......@@ -30,6 +31,7 @@ const LanguageSelector = ({currentLocale, onChange}) => (
LanguageSelector.propTypes = {
currentLocale: PropTypes.string,
label: PropTypes.string,
onChange: PropTypes.func
};
......
......@@ -177,7 +177,7 @@ class MenuBar extends React.Component {
src={dropdownCaret}
/>
</div>
<LanguageSelector aria-label={this.props.intl.formatMessage(ariaMessages.language)} />
<LanguageSelector label={this.props.intl.formatMessage(ariaMessages.language)} />
</div>
<div
className={classNames(styles.menuBarItem, styles.hoverable, {
......
......@@ -25,7 +25,7 @@ describe('Localization', () => {
test('Localization', async () => {
await loadUri(uri);
await clickXpath('//button[@title="Try It"]');
await clickXpath('//*[@aria-label="language selector"]/following-sibling::select');
await clickXpath('//*[@aria-label="language selector"]');
await clickText('Deutsch');
await new Promise(resolve => setTimeout(resolve, 1000)); // wait for blocks refresh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment