Grafana-UI: Add id to Select to make it easier to test (#31230)

* Prettier formatting

* Grafana-UI: Add support for id and inputId props to Select

* Grafana-UI: Add aria-label to Select

* Grafana-UI: InlineField and Field get ID from inputId prop

For Select

* Fix tests using TagFilter

* Update Select prop documentation

* Update Field tests to use screen instead

* Fix the last few tests
This commit is contained in:
Josh Hunt
2021-02-16 16:19:55 +00:00
committed by GitHub
parent 4f61edd28d
commit 85e186cf10
14 changed files with 210 additions and 50 deletions

View File

@@ -93,13 +93,13 @@ export const TagFilter: FC<Props> = ({
};
return (
<div className={styles.tagFilter} aria-label="Tag filter">
<div className={styles.tagFilter}>
{isClearable && tags.length > 0 && (
<span className={styles.clear} onClick={() => onTagChange([])}>
Clear tags
</span>
)}
<AsyncSelect {...selectOptions} prefix={<Icon name="tag-alt" />} />
<AsyncSelect {...selectOptions} prefix={<Icon name="tag-alt" />} aria-label="Tag filter" />
</div>
);
};