Skip to content

Commit

Permalink
fix(Select): add busy
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Mar 4, 2019
1 parent 65ea747 commit beb3eb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const Select = ({
...props
}: SelectProps) => {
return (
<SelectTag { ...props }>
<SelectTag { ...props } aria-busy={ String(loading || false) }>
<ReactSelect
isClearable={ clearable }
isDisabled={ disabled }
Expand Down
4 changes: 4 additions & 0 deletions src/components/Select/Select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('<Select />', () => {
const clearable = true;
const multiple = true;
const hasError = false;
const loading = false;

const wrapper = mount(
<Select
Expand All @@ -23,6 +24,7 @@ describe('<Select />', () => {
placeholder={ placeholder }
options={ options }
value={ options[0] }
loading={ loading }
/>,
);

Expand All @@ -40,10 +42,12 @@ describe('<Select />', () => {
defaultMenuIsOpen: false,
defaultValue: null,
menuPlacement: 'auto',
isLoading: loading,
});

expect(passedStyledProps).toEqual({
hasError,
'aria-busy': String(loading),
});
});
});

0 comments on commit beb3eb2

Please sign in to comment.