diff --git a/CHANGELOG.md b/CHANGELOG.md index dafc72db60a..7ded7a1471e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # [`master`](https://github.com/elastic/eui/tree/master) +- Added support for `disabled` options in `EuiSelect`. [#324](https://github.com/elastic/eui/pull/324) - Badges can now accept onClicks and custom colors. They were changed stylistically to be bolder and smaller by default. ([#381](https://github.com/elastic/eui/pull/381)) - Added component to wrap blocks of substeps `EuiSubSteps` in a shaded container. ([#375](https://github.com/elastic/eui/pull/375)) - Added horizontal steps component ([#375](https://github.com/elastic/eui/pull/375)) diff --git a/src/components/form/select/__snapshots__/select.test.js.snap b/src/components/form/select/__snapshots__/select.test.js.snap index 2892acd89f3..cbced5b237e 100644 --- a/src/components/form/select/__snapshots__/select.test.js.snap +++ b/src/components/form/select/__snapshots__/select.test.js.snap @@ -19,6 +19,33 @@ exports[`EuiSelect is rendered 1`] = ` `; +exports[`EuiSelect props disabled options are rendered 1`] = ` + + + + + +`; + exports[`EuiSelect props fullWidth is rendered 1`] = ` - {options.map((option, index) => ( - - ))} + {options.map((option, index) => { + const { + text, + ...rest + } = option; + return ; + })} @@ -58,8 +62,7 @@ EuiSelect.propTypes = { name: PropTypes.string, id: PropTypes.string, options: PropTypes.arrayOf(PropTypes.shape({ - value: PropTypes.string.isRequired, - text: PropTypes.string.isRequired, + text: PropTypes.string.isRequired })).isRequired, isInvalid: PropTypes.bool, fullWidth: PropTypes.bool, diff --git a/src/components/form/select/select.test.js b/src/components/form/select/select.test.js index cfb984e0aa5..65679aef148 100644 --- a/src/components/form/select/select.test.js +++ b/src/components/form/select/select.test.js @@ -62,5 +62,19 @@ describe('EuiSelect', () => { expect(component) .toMatchSnapshot(); }); + + test('disabled options are rendered', () => { + const component = render( + + ); + + expect(component) + .toMatchSnapshot(); + }); }); });