Skip to content

Commit

Permalink
Revert "Remove obsolete test & changelog"
Browse files Browse the repository at this point in the history
This reverts commit a5b1d33.
  • Loading branch information
cchaos committed Aug 16, 2018
1 parent a5b1d33 commit d927eef
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 1 deletion.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `zIndexAdjustment` to `EuiPopover` which allows tweaking the popover content's `z-index` ([#1097](https://github.com/elastic/eui/pull/1097))
- Added new `EuiSuperSelect` component and `hasArrow` prop to `EuiPopover` ([#921](https://github.com/elastic/eui/pull/921))

## [`3.6.1`](https://github.com/elastic/eui/tree/v3.6.1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,141 @@ exports[`EuiSuperSelect props more props are propogated to each option 2`] = `
</EuiSuperSelect>
`;

exports[`EuiSuperSelect props options are rendered when select is open 1`] = `
<div
class="euiPopover euiPopover--anchorDownCenter euiSuperSelect"
>
<div
class="euiPopover__anchor"
>
<input
type="hidden"
value=""
/>
<div
class="euiFormControlLayout"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<span
class="euiScreenReaderOnly"
id="generated-id"
>
Select an option: , is selected
</span>
<button
aria-haspopup="true"
aria-labelledby="undefined generated-id"
class="euiSuperSelectControl euiSuperSelect--isOpen__button"
data-test-subj="superSelect"
role="option"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<span
class="euiFormControlLayoutCustomIcon"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/>
</defs>
<use
fill-rule="nonzero"
xlink:href="#arrow_down-a"
/>
</svg>
</span>
</div>
</div>
</div>
</div>
<div>
<div
aria-live="assertive"
class="euiPanel euiPopover__panel euiPopover__panel--bottom euiPopover__panel-noArrow euiSuperSelect__popoverPanel"
style="top: 8px; left: -22px; z-index: 0;"
>
<div
class="euiPopover__panelArrow euiPopover__panelArrow--bottom"
/>
<p
class="euiScreenReaderOnly"
role="alert"
>
You are in a form selector of 2 items and must select a single option. Use the up and down keys to navigate or escape to close.
</p>
<div
role="listbox"
>
<button
class="euiContextMenuItem euiSuperSelect__item"
id="1"
role="option"
type="button"
>
<span
class="euiContextMenu__itemLayout"
>
<svg
class="euiIcon euiIcon--medium euiContextMenu__icon"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
<span
class="euiContextMenuItem__text"
>
Option #1
</span>
</span>
</button>
<button
class="euiContextMenuItem euiSuperSelect__item"
id="2"
role="option"
type="button"
>
<span
class="euiContextMenu__itemLayout"
>
<svg
class="euiIcon euiIcon--medium euiContextMenu__icon"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
<span
class="euiContextMenuItem__text"
>
Option #2
</span>
</span>
</button>
</div>
</div>
</div>
</div>
`;

exports[`EuiSuperSelect props select component is rendered 1`] = `
<div
class="euiPopover euiPopover--anchorDownCenter euiSuperSelect"
Expand Down
18 changes: 18 additions & 0 deletions src/components/form/super_select/super_select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ describe('EuiSuperSelect', () => {
.toMatchSnapshot();
});

test('options are rendered when select is open', () => {
const component = mount(
<EuiSuperSelect
options={[
{ value: '1', inputDisplay: 'Option #1' },
{ value: '2', inputDisplay: 'Option #2' }
]}
onChange={() => {}}
data-test-subj="superSelect"
/>
);

component.find('button[data-test-subj="superSelect"]').simulate('click');

expect(takeMountedSnapshot(component))
.toMatchSnapshot();
});

test('valueSelected is rendered', () => {
const component = render(
<EuiSuperSelect
Expand Down

0 comments on commit d927eef

Please sign in to comment.