@patternfly/react-core 4.199.5 → 4.200.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/esm/components/Avatar/Avatar.d.ts +2 -0
- package/dist/esm/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +2 -2
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/FormSelect/FormSelect.d.ts +2 -0
- package/dist/esm/components/FormSelect/FormSelect.d.ts.map +1 -1
- package/dist/esm/components/FormSelect/FormSelect.js +3 -2
- package/dist/esm/components/FormSelect/FormSelect.js.map +1 -1
- package/dist/esm/components/TextArea/TextArea.d.ts +2 -0
- package/dist/esm/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/esm/components/TextArea/TextArea.js +4 -3
- package/dist/esm/components/TextArea/TextArea.js.map +1 -1
- package/dist/esm/components/TextInput/TextInput.d.ts +2 -0
- package/dist/esm/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/esm/components/TextInput/TextInput.js +3 -2
- package/dist/esm/components/TextInput/TextInput.js.map +1 -1
- package/dist/js/components/Avatar/Avatar.d.ts +2 -0
- package/dist/js/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/js/components/Avatar/Avatar.js +2 -2
- package/dist/js/components/Avatar/Avatar.js.map +1 -1
- package/dist/js/components/FormSelect/FormSelect.d.ts +2 -0
- package/dist/js/components/FormSelect/FormSelect.d.ts.map +1 -1
- package/dist/js/components/FormSelect/FormSelect.js +3 -2
- package/dist/js/components/FormSelect/FormSelect.js.map +1 -1
- package/dist/js/components/TextArea/TextArea.d.ts +2 -0
- package/dist/js/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/js/components/TextArea/TextArea.js +4 -3
- package/dist/js/components/TextArea/TextArea.js.map +1 -1
- package/dist/js/components/TextInput/TextInput.d.ts +2 -0
- package/dist/js/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/js/components/TextInput/TextInput.js +3 -2
- package/dist/js/components/TextInput/TextInput.js.map +1 -1
- package/dist/umd/react-core.js +12 -9
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +5 -5
- package/src/components/Avatar/Avatar.tsx +4 -0
- package/src/components/Avatar/examples/Avatar.md +33 -4
- package/src/components/ChipGroup/__tests__/ChipGroup.test.tsx +14 -9
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyToggle.test.tsx +28 -19
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +1 -1
- package/src/components/ContextSelector/__tests__/ContextSelector.test.tsx +21 -14
- package/src/components/ContextSelector/__tests__/ContextSelectorToggle.test.tsx +49 -34
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +2 -169
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelectorToggle.test.tsx.snap +5 -247
- package/src/components/DataList/__tests__/DataList.test.tsx +49 -40
- package/src/components/DataList/__tests__/__snapshots__/DataList.test.tsx.snap +1 -9
- package/src/components/Dropdown/__tests__/Dropdown.test.tsx +54 -42
- package/src/components/Dropdown/__tests__/DropdownToggle.test.tsx +179 -177
- package/src/components/Dropdown/__tests__/DropdownToggleCheckbox.test.tsx +51 -55
- package/src/components/Dropdown/__tests__/Generated/DropdownItem.test.tsx +28 -26
- package/src/components/Dropdown/__tests__/Generated/DropdownSeparator.test.tsx +14 -15
- package/src/components/Dropdown/__tests__/Generated/InternalDropdownItem.test.tsx +39 -36
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownItem.test.tsx.snap +6 -4
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownSeparator.test.tsx.snap +11 -4
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap +7 -4
- package/src/components/Dropdown/__tests__/InternalDropdownItem.test.tsx +66 -69
- package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +15 -816
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggle.test.tsx.snap +9 -454
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggleCheckbox.test.tsx.snap +7 -141
- package/src/components/Dropdown/__tests__/__snapshots__/InternalDropdownItem.test.tsx.snap +10 -163
- package/src/components/FormSelect/FormSelect.tsx +16 -1
- package/src/components/FormSelect/examples/FormSelect.md +58 -0
- package/src/components/Nav/__tests__/Generated/NavList.test.tsx +28 -18
- package/src/components/Nav/__tests__/Generated/__snapshots__/NavList.test.tsx.snap +8 -4
- package/src/components/OptionsMenu/__tests__/Generated/OptionsMenuItem.test.tsx +21 -19
- package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenuItem.test.tsx.snap +20 -11
- package/src/components/OverflowMenu/__tests__/Generated/OverflowMenuDropdownItem.test.tsx +14 -10
- package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuDropdownItem.test.tsx.snap +18 -4
- package/src/components/Select/__tests__/Generated/SelectGroup.test.tsx +22 -10
- package/src/components/Select/__tests__/Generated/SelectMenu.test.tsx +22 -26
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectGroup.test.tsx.snap +15 -4
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +7 -19
- package/src/components/Select/__tests__/SelectGroup.test.tsx +14 -7
- package/src/components/Select/__tests__/SelectOption.test.tsx +51 -30
- package/src/components/Select/__tests__/__snapshots__/SelectGroup.test.tsx.snap +1 -5
- package/src/components/Select/__tests__/__snapshots__/SelectOption.test.tsx.snap +10 -272
- package/src/components/TextArea/TextArea.tsx +5 -0
- package/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap +2 -0
- package/src/components/TextArea/examples/TextArea.md +43 -0
- package/src/components/TextInput/TextInput.tsx +5 -0
- package/src/components/TextInput/__tests__/__snapshots__/TextInput.test.tsx.snap +2 -0
- package/src/components/TextInput/examples/TextInput.md +104 -27
- package/src/components/Toolbar/__tests__/Generated/ToolbarToggleGroup.test.tsx +25 -11
- package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap +26 -4
- package/src/components/Toolbar/__tests__/Toolbar.test.tsx +129 -0
- package/src/components/Toolbar/__tests__/ToolbarItem.test.tsx +19 -0
- package/src/components/Toolbar/__tests__/ToolbarToggleGroup.test.tsx +12 -135
- package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +7 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.test.tsx.snap +3 -0
- package/src/components/Tooltip/examples/Tooltip.md +9 -1
- package/src/components/Tooltip/examples/TooltipExamples.css +4 -4
- package/src/components/Select/__tests__/Generated/SelectOption.test.tsx +0 -29
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectOption.test.tsx.snap +0 -7
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarToggleGroup.test.tsx.snap +0 -516
- package/src/components/Wizard/__tests__/Generated/Wizard.test.tsx +0 -43
- package/src/components/Wizard/__tests__/Generated/__snapshots__/Wizard.test.tsx.snap +0 -69
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
|
|
4
6
|
import { DropdownToggleCheckbox } from '../DropdownToggleCheckbox';
|
|
5
7
|
|
|
6
8
|
const props = {
|
|
@@ -8,56 +10,50 @@ const props = {
|
|
|
8
10
|
isChecked: false
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<DropdownToggleCheckbox label="label" className="class-123" id="check" isChecked aria-label="check" />
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
target: { checked: newValue }
|
|
58
|
-
};
|
|
59
|
-
const view = mount(<DropdownToggleCheckbox id="check" {...props} aria-label="check" />);
|
|
60
|
-
view.find('input').simulate('change', event);
|
|
61
|
-
expect(props.onChange.mock.calls[0][0]).toBe(newValue);
|
|
62
|
-
expect(props.onChange.mock.calls[0][1]).toMatchObject(event);
|
|
13
|
+
describe('DropdownToggleCheckbox', () => {
|
|
14
|
+
test('controlled', () => {
|
|
15
|
+
render(<DropdownToggleCheckbox isChecked id="check" aria-label="check" />);
|
|
16
|
+
expect(screen.getByRole('checkbox').outerHTML).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('uncontrolled', () => {
|
|
20
|
+
render(<DropdownToggleCheckbox id="check" aria-label="check" />);
|
|
21
|
+
expect(screen.getByRole('checkbox').outerHTML).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('with text', () => {
|
|
25
|
+
render(
|
|
26
|
+
<DropdownToggleCheckbox id="check" isDisabled aria-label="check">
|
|
27
|
+
Some text
|
|
28
|
+
</DropdownToggleCheckbox>
|
|
29
|
+
);
|
|
30
|
+
expect(screen.getByRole('checkbox').parentElement.outerHTML).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('isDisabled', () => {
|
|
34
|
+
render(<DropdownToggleCheckbox id="check" isDisabled aria-label="check" />);
|
|
35
|
+
expect(screen.getByRole('checkbox').outerHTML).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('3rd state', () => {
|
|
39
|
+
render(<DropdownToggleCheckbox id="check" isChecked={null} aria-label="check" />);
|
|
40
|
+
expect(screen.getByRole('checkbox').outerHTML).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('passing class', () => {
|
|
44
|
+
render(<DropdownToggleCheckbox label="label" className="class-123" id="check" isChecked aria-label="check" />);
|
|
45
|
+
expect(screen.getByRole('checkbox').outerHTML).toMatchSnapshot();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('passing HTML attribute', () => {
|
|
49
|
+
render(<DropdownToggleCheckbox label="label" aria-labelledby="labelId" id="check" isChecked aria-label="check" />);
|
|
50
|
+
expect(screen.getByRole('checkbox').outerHTML).toMatchSnapshot();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('checkbox passes value and event to onChange handler', () => {
|
|
54
|
+
render(<DropdownToggleCheckbox id="check" {...props} aria-label="check" />);
|
|
55
|
+
|
|
56
|
+
userEvent.click(screen.getByRole('checkbox'));
|
|
57
|
+
expect(props.onChange.mock.calls[0][0]).toBe(true);
|
|
58
|
+
});
|
|
63
59
|
});
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { DropdownItem } from '../../DropdownItem';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { DropdownArrowContext } from '../../dropdownConstants';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
describe('DropdownItem', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<DropdownArrowContext.Provider value={{ sendRef: jest.fn(), keyHandler: undefined }}>
|
|
12
|
+
<DropdownItem
|
|
13
|
+
children={<>ReactNode</>}
|
|
14
|
+
className={"''"}
|
|
15
|
+
listItemClassName={'string'}
|
|
16
|
+
component={'a'}
|
|
17
|
+
isDisabled={false}
|
|
18
|
+
isPlainText={false}
|
|
19
|
+
isHovered={false}
|
|
20
|
+
href={'string'}
|
|
21
|
+
tooltip={null}
|
|
22
|
+
tooltipProps={undefined}
|
|
23
|
+
additionalChild={<div>ReactNode</div>}
|
|
24
|
+
customChild={<div>ReactNode</div>}
|
|
25
|
+
icon={null}
|
|
26
|
+
/>
|
|
27
|
+
</DropdownArrowContext.Provider>
|
|
28
|
+
);
|
|
29
|
+
expect(view.container).toMatchSnapshot();
|
|
30
|
+
});
|
|
29
31
|
});
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { DropdownSeparator } from '../../DropdownSeparator';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { DropdownArrowContext } from '../../dropdownConstants';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
describe('DropdownSeparator', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<DropdownArrowContext.Provider value={{ sendRef: jest.fn(), keyHandler: undefined }}>
|
|
12
|
+
<DropdownSeparator className={"''"} onClick={() => console.log('clicked')} />
|
|
13
|
+
</DropdownArrowContext.Provider>
|
|
14
|
+
);
|
|
15
|
+
expect(view.container).toMatchSnapshot();
|
|
16
|
+
});
|
|
18
17
|
});
|
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { InternalDropdownItem } from '../../InternalDropdownItem';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { DropdownContext } from '../../dropdownConstants';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
8
|
+
describe('InternalDropdownItem', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<DropdownContext.Provider value={{}}>
|
|
12
|
+
{' '}
|
|
13
|
+
<InternalDropdownItem
|
|
14
|
+
children={<div>ReactNode</div>}
|
|
15
|
+
className={"''"}
|
|
16
|
+
listItemClassName={'string'}
|
|
17
|
+
component={'a'}
|
|
18
|
+
role={"'none'"}
|
|
19
|
+
isDisabled={false}
|
|
20
|
+
isPlainText={false}
|
|
21
|
+
isHovered={false}
|
|
22
|
+
href={'string'}
|
|
23
|
+
tooltip={<div>ReactNode</div>}
|
|
24
|
+
tooltipProps={undefined}
|
|
25
|
+
index={-1}
|
|
26
|
+
context={{
|
|
27
|
+
keyHandler: () => {},
|
|
28
|
+
sendRef: () => {}
|
|
29
|
+
}}
|
|
30
|
+
onClick={(event: React.MouseEvent<any> | React.KeyboardEvent | MouseEvent) => undefined as any}
|
|
31
|
+
id={'string'}
|
|
32
|
+
componentID={'string'}
|
|
33
|
+
additionalChild={<div>ReactNode</div>}
|
|
34
|
+
customChild={<div>ReactNode</div>}
|
|
35
|
+
enterTriggersArrowDown={false}
|
|
36
|
+
icon={<div>ReactNode</div>}
|
|
37
|
+
/>
|
|
38
|
+
</DropdownContext.Provider>
|
|
39
|
+
);
|
|
40
|
+
expect(view.container).toMatchSnapshot();
|
|
41
|
+
});
|
|
39
42
|
});
|
package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownItem.test.tsx.snap
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`DropdownItem should match snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
3
|
+
exports[`DropdownItem should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div>
|
|
6
|
+
ReactNode
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
7
9
|
`;
|
package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownSeparator.test.tsx.snap
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`DropdownSeparator should match snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
3
|
+
exports[`DropdownSeparator should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<li
|
|
6
|
+
role="separator"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="pf-c-divider ''"
|
|
10
|
+
role="separator"
|
|
11
|
+
/>
|
|
12
|
+
</li>
|
|
13
|
+
</div>
|
|
7
14
|
`;
|
package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`InternalDropdownItem should match snapshot
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
exports[`InternalDropdownItem should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
|
|
6
|
+
<div>
|
|
7
|
+
ReactNode
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
7
10
|
`;
|
|
@@ -1,84 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
4
3
|
import { InternalDropdownItem } from '../InternalDropdownItem';
|
|
5
|
-
import { DropdownSeparator } from '../DropdownSeparator';
|
|
6
4
|
|
|
7
|
-
describe('
|
|
8
|
-
|
|
9
|
-
const view = render(<InternalDropdownItem>Something</InternalDropdownItem>);
|
|
10
|
-
expect(view.container).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test('button', () => {
|
|
14
|
-
const view = render(<InternalDropdownItem component="button">Something</InternalDropdownItem>);
|
|
15
|
-
expect(view.container).toMatchSnapshot();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('separator', () => {
|
|
19
|
-
const view = shallow(<DropdownSeparator />);
|
|
20
|
-
expect(view).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('hover', () => {
|
|
5
|
+
describe('InternalDropdownItem', () => {
|
|
6
|
+
describe('dropdown items', () => {
|
|
24
7
|
test('a', () => {
|
|
25
|
-
|
|
26
|
-
expect(
|
|
8
|
+
render(<InternalDropdownItem>Something</InternalDropdownItem>);
|
|
9
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
27
10
|
});
|
|
28
|
-
test('button', () => {
|
|
29
|
-
const view = render(
|
|
30
|
-
<InternalDropdownItem isHovered component="button">
|
|
31
|
-
Something
|
|
32
|
-
</InternalDropdownItem>
|
|
33
|
-
);
|
|
34
|
-
expect(view.container).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
11
|
|
|
38
|
-
describe('disabled', () => {
|
|
39
|
-
test('a', () => {
|
|
40
|
-
const view = render(<InternalDropdownItem isDisabled>Something</InternalDropdownItem>);
|
|
41
|
-
expect(view.container).toMatchSnapshot();
|
|
42
|
-
});
|
|
43
12
|
test('button', () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Something
|
|
47
|
-
</InternalDropdownItem>
|
|
48
|
-
);
|
|
49
|
-
expect(view.container).toMatchSnapshot();
|
|
13
|
+
render(<InternalDropdownItem component="button">Something</InternalDropdownItem>);
|
|
14
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
50
15
|
});
|
|
51
|
-
});
|
|
52
16
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
17
|
+
describe('hover', () => {
|
|
18
|
+
test('a', () => {
|
|
19
|
+
render(<InternalDropdownItem isHovered>Something</InternalDropdownItem>);
|
|
20
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('button', () => {
|
|
24
|
+
render(
|
|
25
|
+
<InternalDropdownItem isHovered component="button">
|
|
26
|
+
Something
|
|
27
|
+
</InternalDropdownItem>
|
|
28
|
+
);
|
|
29
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
30
|
+
});
|
|
57
31
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
64
|
-
|
|
32
|
+
|
|
33
|
+
describe('disabled', () => {
|
|
34
|
+
test('a', () => {
|
|
35
|
+
render(<InternalDropdownItem isDisabled>Something</InternalDropdownItem>);
|
|
36
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('button', () => {
|
|
40
|
+
render(
|
|
41
|
+
<InternalDropdownItem isDisabled component="button">
|
|
42
|
+
Something
|
|
43
|
+
</InternalDropdownItem>
|
|
44
|
+
);
|
|
45
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
46
|
+
});
|
|
65
47
|
});
|
|
66
|
-
});
|
|
67
48
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
|
|
49
|
+
describe('aria-disabled', () => {
|
|
50
|
+
test('a', () => {
|
|
51
|
+
render(<InternalDropdownItem isAriaDisabled>Something</InternalDropdownItem>);
|
|
52
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('button', () => {
|
|
56
|
+
render(
|
|
57
|
+
<InternalDropdownItem isAriaDisabled component="button">
|
|
58
|
+
Something
|
|
59
|
+
</InternalDropdownItem>
|
|
60
|
+
);
|
|
61
|
+
expect(screen.getByText('Something').outerHTML).toMatchSnapshot();
|
|
62
|
+
});
|
|
74
63
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
);
|
|
81
|
-
|
|
64
|
+
|
|
65
|
+
describe('description', () => {
|
|
66
|
+
test('a', () => {
|
|
67
|
+
render(<InternalDropdownItem description="Something's link description">Something</InternalDropdownItem>);
|
|
68
|
+
expect(screen.getByText("Something's link description").outerHTML).toMatchSnapshot();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('button', () => {
|
|
72
|
+
render(
|
|
73
|
+
<InternalDropdownItem description="Something's button description" component="button">
|
|
74
|
+
Something
|
|
75
|
+
</InternalDropdownItem>
|
|
76
|
+
);
|
|
77
|
+
expect(screen.getByText("Something's button description").outerHTML).toMatchSnapshot();
|
|
78
|
+
});
|
|
82
79
|
});
|
|
83
80
|
});
|
|
84
81
|
});
|