Merge pull request #8563 from AlexSCorey/8535-UpgradePF

Updates PF dependency

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-11-16 18:16:17 +00:00 committed by GitHub
commit 00fb955544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 189 additions and 280 deletions

View File

@ -3013,38 +3013,45 @@
"dev": true
},
"@patternfly/patternfly": {
"version": "4.23.3",
"resolved": "https://registry.npmjs.org/@patternfly/patternfly/-/patternfly-4.23.3.tgz",
"integrity": "sha512-q8C98ihcRYBY+FB+KY3bQ9y1Pn/NjBff4hwKsxatrs/MSO/++CuEncg4q7WHjIq2zadA4/7W+Vg3CXuiOP0geg=="
"version": "4.59.1",
"resolved": "https://registry.npmjs.org/@patternfly/patternfly/-/patternfly-4.59.1.tgz",
"integrity": "sha512-zk3aqg62JXMTzzJMJsyVgt5fXlcxUUkRKkaxUv/hwpjhGiyLexZ1l3Gupb9ziYl74p38KzbbfcfdnlFCwJZfgg=="
},
"@patternfly/react-core": {
"version": "4.32.1",
"resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-4.32.1.tgz",
"integrity": "sha512-4FrKJvMfjHjWtmvGu1QVxo/nCdUgePlkdNzMs91r0wdL16CpfoQVtZcfZe4343fRAQ2ObeYfZ2GuiwvS1sw8Og==",
"version": "4.75.2",
"resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-4.75.2.tgz",
"integrity": "sha512-hoCeTahVgl5I0jA74/so2bZL1eabSD2Uwt8uYgz+W+ShYAC4rJreLOVn43I15J5VPpwIvxrbubccpBqCGL2+wA==",
"requires": {
"@patternfly/react-icons": "^4.5.0",
"@patternfly/react-styles": "^4.5.0",
"@patternfly/react-tokens": "^4.6.0",
"@patternfly/react-icons": "^4.7.16",
"@patternfly/react-styles": "^4.7.12",
"@patternfly/react-tokens": "^4.9.16",
"focus-trap": "4.0.2",
"react-dropzone": "9.0.0",
"tippy.js": "5.1.2",
"tslib": "^1.11.1"
"tslib": "1.13.0"
},
"dependencies": {
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
}
}
},
"@patternfly/react-icons": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-4.5.0.tgz",
"integrity": "sha512-wXAENYa6nST4D8DBkiCrZXf4aRTmVQNA4cyImMJ3aQWAzwJ7Xc1zIBBuYSX5EP0JOuf9DzWVCrzvgfQz1Fcx8g=="
"version": "4.7.16",
"resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-4.7.16.tgz",
"integrity": "sha512-g1RsaGy/FRsHINdHpHR9RNhC72qs5W/0wIUQVB0HPtCrXdr1UfJCh03RRIhixfGPQDYgw9Ou3j3rARljhwUPUw=="
},
"@patternfly/react-styles": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-4.5.0.tgz",
"integrity": "sha512-6w8mvxx/cC+yUzBKlWY8YRnavlWCTLWly1si0skleYPF1t69f3P+jeXNy39kH6+o2vXJR5MeecLrnuMV0XtKvg=="
"version": "4.7.12",
"resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-4.7.12.tgz",
"integrity": "sha512-+IfOc0E440Q61IYQZbux7pwcLf7JWQd1rOs2DDWnoVaw82zr/BZMtGh9T2kcklcH7TUHavSyF6tlCgU40IQ/4g=="
},
"@patternfly/react-tokens": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-4.6.0.tgz",
"integrity": "sha512-zpA4AlYqJNJm5aqsarBVjod1gjP9muJ5oWI2ZwGUFiw4YNRn8eY7QKQ1VvNZxqwI+WSXl98jTqJiKuJGF3DEvw=="
"version": "4.9.16",
"resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-4.9.16.tgz",
"integrity": "sha512-gqwhMDYHB2R01PlmT+CwaIQiXvc8s7ZywpLpO63rWjy+37cgtgBMApIxZx2tALTuJDYTmu9F/SUce5CUQIgwkQ=="
},
"@svgr/babel-plugin-add-jsx-attribute": {
"version": "4.2.0",
@ -8272,11 +8279,18 @@
}
},
"file-selector": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.1.12.tgz",
"integrity": "sha512-Kx7RTzxyQipHuiqyZGf+Nz4vY9R1XGxuQl/hLoJwq+J4avk/9wxxgZyHKtbyIPJmbD4A66DWGYfyykWNpcYutQ==",
"version": "0.1.18",
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.1.18.tgz",
"integrity": "sha512-MUY65bNFSE+VraxNpxAz04vDlPuh5qENA0WtfgDWoDnKV7ZN2InI8AbSp0F/3aHoJJVKmZ+cqachhVoBNGifWA==",
"requires": {
"tslib": "^1.9.0"
"tslib": "^2.0.1"
},
"dependencies": {
"tslib": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
}
}
},
"filesize": {

View File

@ -7,9 +7,9 @@
},
"dependencies": {
"@lingui/react": "^2.9.1",
"@patternfly/patternfly": "^4.23.3",
"@patternfly/react-core": "^4.32.1",
"@patternfly/react-icons": "^4.5.0",
"@patternfly/patternfly": "4.59.1",
"@patternfly/react-core": "4.75.2",
"@patternfly/react-icons": "4.7.16",
"ansi-to-html": "^0.6.11",
"axios": "^0.18.1",
"codemirror": "^5.47.0",

View File

@ -7,12 +7,10 @@ class NavExpandableGroup extends Component {
constructor(props) {
super(props);
const { routes } = this.props;
this.state = { isExpanded: true };
// Extract a list of paths from the route params and store them for later. This creates
// an array of url paths associated with any NavItem component rendered by this component.
this.navItemPaths = routes.map(({ path }) => path);
this.handleExpand = this.handleExpand.bind(this);
this.isActiveGroup = this.isActiveGroup.bind(this);
this.isActivePath = this.isActivePath.bind(this);
}
@ -26,13 +24,8 @@ class NavExpandableGroup extends Component {
return Boolean(matchPath(history.location.pathname, { path }));
}
handleExpand(e, isExpanded) {
this.setState({ isExpanded });
}
render() {
const { groupId, groupTitle, routes } = this.props;
const { isExpanded } = this.state;
if (routes.length === 1) {
const [{ path }] = routes;
@ -46,10 +39,8 @@ class NavExpandableGroup extends Component {
return (
<NavExpandable
isActive={this.isActiveGroup()}
isExpanded={isExpanded}
groupId={groupId}
title={groupTitle}
onExpand={this.handleExpand}
>
{routes.map(({ path, title }) => (
<NavItem

View File

@ -343,12 +343,10 @@ describe('<DataListToolbar />', () => {
]}
/>
);
await act(() =>
newToolbar.find('Search').prop('onShowAdvancedSearch')(true)
);
act(() => newToolbar.find('Search').prop('onShowAdvancedSearch')(true));
newToolbar.update();
expect(newToolbar.find('KebabToggle').length).toBe(1);
await act(() => newToolbar.find('KebabToggle').prop('onToggle')(true));
act(() => newToolbar.find('KebabToggle').prop('onToggle')(true));
newToolbar.update();
expect(newToolbar.find('div[aria-label="add container"]').length).toBe(1);
expect(newToolbar.find('div[aria-label="add instance group"]').length).toBe(

View File

@ -8,17 +8,17 @@ describe('<TagMultiSelect />', () => {
<TagMultiSelect value="foo,bar" onChange={jest.fn()} />
);
wrapper.find('input').simulate('focus');
const options = wrapper.find('SelectOption');
const options = wrapper.find('Chip');
expect(options).toHaveLength(2);
expect(options.at(0).prop('value')).toEqual('foo');
expect(options.at(1).prop('value')).toEqual('bar');
expect(options.at(0).text()).toEqual('foo');
expect(options.at(1).text()).toEqual('bar');
});
it('should not treat empty string as an option', () => {
const wrapper = mount(<TagMultiSelect value="" onChange={jest.fn()} />);
wrapper.find('input').simulate('focus');
wrapper.find('SelectToggle').simulate('click');
expect(wrapper.find('Select').prop('isOpen')).toEqual(true);
expect(wrapper.find('SelectOption')).toHaveLength(0);
expect(wrapper.find('Chip')).toHaveLength(0);
});
it('should trigger onChange', () => {

View File

@ -26,7 +26,9 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
>
<DataListItem
aria-labelledby="items-list-item-9000"
className=""
id="9000"
isExpanded={false}
key="9000"
>
<li
@ -283,7 +285,7 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
>
<label
className="pf-c-switch"
data-ouia-component-id={0}
data-ouia-component-id="OUIA-Generated-Switch-1"
data-ouia-component-type="PF4/Switch"
data-ouia-safe={true}
htmlFor="notification-9000-started-toggle"
@ -328,7 +330,7 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
>
<label
className="pf-c-switch"
data-ouia-component-id={1}
data-ouia-component-id="OUIA-Generated-Switch-2"
data-ouia-component-type="PF4/Switch"
data-ouia-safe={true}
htmlFor="notification-9000-success-toggle"
@ -373,7 +375,7 @@ exports[`<NotificationListItem canToggleNotifications /> initially renders succe
>
<label
className="pf-c-switch"
data-ouia-component-id={2}
data-ouia-component-id="OUIA-Generated-Switch-3"
data-ouia-component-type="PF4/Switch"
data-ouia-safe={true}
htmlFor="notification-9000-error-toggle"

View File

@ -99,11 +99,12 @@ exports[`<ToolbarDeleteButton /> should render button 1`] = `
aria-disabled={true}
aria-label="Delete"
className="pf-c-button pf-m-secondary pf-m-disabled"
data-ouia-component-id={0}
data-ouia-component-id="OUIA-Generated-Button-secondary-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={true}
onClick={[Function]}
role={null}
tabIndex={null}
type="button"
>

View File

@ -86,122 +86,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
</Button>,
]
}
appendTo={
<body
class="pf-c-backdrop__open"
>
<div>
<div
class="pf-c-backdrop"
>
<div
class="pf-l-bullseye"
>
<div
aria-describedby="pf-modal-part-2"
aria-label="Alert modal"
aria-labelledby="pf-modal-part-0 alert-modal-header-label pf-modal-part-1"
aria-modal="true"
class="pf-c-modal-box pf-m-sm"
data-ouia-component-id="0"
data-ouia-component-type="PF4/ModalContent"
data-ouia-safe="true"
id="pf-modal-part-0"
role="dialog"
>
<button
aria-disabled="false"
aria-label="Close"
class="pf-c-button pf-m-plain"
data-ouia-component-id="1"
data-ouia-component-type="PF4/Button"
data-ouia-safe="true"
type="button"
>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
role="img"
style="vertical-align: -0.125em;"
viewBox="0 0 352 512"
width="1em"
>
<path
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
transform=""
/>
</svg>
</button>
<header
class="pf-c-modal-box__header"
>
<div
class="AlertModal__Header-l9z1bu-0 hQFWHX"
>
<svg
aria-hidden="true"
class="AlertModal___StyledExclamationCircleIcon-l9z1bu-1 jOhcwt"
fill="currentColor"
height="2em"
role="img"
style="vertical-align: -0.25em;"
viewBox="0 0 512 512"
width="2em"
>
<path
d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
transform=""
/>
</svg>
<h2
class="pf-c-title pf-m-2xl"
id="alert-modal-header-label"
>
Remove Team Access
</h2>
</div>
</header>
<div
class="pf-c-modal-box__body"
id="pf-modal-part-2"
>
Are you sure you want to remove Member access from The Team? Doing so affects all members of the team.
<br />
<br />
If you only want to remove access for this particular user, please remove them from the team.
</div>
<footer
class="pf-c-modal-box__footer"
>
<button
aria-disabled="false"
aria-label="Confirm delete"
class="pf-c-button pf-m-danger"
data-ouia-component-id="2"
data-ouia-component-type="PF4/Button"
data-ouia-safe="true"
type="button"
>
Delete
</button>
<button
aria-disabled="false"
class="pf-c-button pf-m-secondary"
data-ouia-component-id="3"
data-ouia-component-type="PF4/Button"
data-ouia-safe="true"
type="button"
>
Cancel
</button>
</footer>
</div>
</div>
</div>
</div>
</body>
}
appendTo={[Function]}
aria-describedby=""
aria-label="Alert modal"
aria-labelledby="alert-modal-header-label"
@ -226,6 +111,8 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
ouiaSafe={true}
showClose={true}
title="Remove Team Access"
titleIconVariant={null}
titleLabel=""
variant="small"
>
<Portal
@ -243,7 +130,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-labelledby="pf-modal-part-0 alert-modal-header-label pf-modal-part-1"
aria-modal="true"
class="pf-c-modal-box pf-m-sm"
data-ouia-component-id="0"
data-ouia-component-id="OUIA-Generated-Modal-small-1"
data-ouia-component-type="PF4/ModalContent"
data-ouia-safe="true"
id="pf-modal-part-0"
@ -253,7 +140,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-disabled="false"
aria-label="Close"
class="pf-c-button pf-m-plain"
data-ouia-component-id="1"
data-ouia-component-id="OUIA-Generated-Button-plain-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe="true"
type="button"
@ -269,7 +156,6 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
>
<path
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
transform=""
/>
</svg>
</button>
@ -291,7 +177,6 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
>
<path
d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
transform=""
/>
</svg>
<h2
@ -318,7 +203,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-disabled="false"
aria-label="Confirm delete"
class="pf-c-button pf-m-danger"
data-ouia-component-id="2"
data-ouia-component-id="OUIA-Generated-Button-danger-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe="true"
type="button"
@ -328,7 +213,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
<button
aria-disabled="false"
class="pf-c-button pf-m-secondary"
data-ouia-component-id="3"
data-ouia-component-id="OUIA-Generated-Button-secondary-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe="true"
type="button"
@ -384,9 +269,12 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
isOpen={true}
labelId="pf-modal-part-1"
onClose={[Function]}
ouiaId="OUIA-Generated-Modal-small-1"
ouiaSafe={true}
showClose={true}
title="Remove Team Access"
titleIconVariant={null}
titleLabel=""
variant="small"
>
<Backdrop>
@ -411,7 +299,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-label="Alert modal"
aria-labelledby="pf-modal-part-0 alert-modal-header-label pf-modal-part-1"
className=""
data-ouia-component-id={0}
data-ouia-component-id="OUIA-Generated-Modal-small-1"
data-ouia-component-type="PF4/ModalContent"
data-ouia-safe={true}
id="pf-modal-part-0"
@ -424,7 +312,7 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-labelledby="pf-modal-part-0 alert-modal-header-label pf-modal-part-1"
aria-modal="true"
className="pf-c-modal-box pf-m-sm"
data-ouia-component-id={0}
data-ouia-component-id="OUIA-Generated-Modal-small-1"
data-ouia-component-type="PF4/ModalContent"
data-ouia-safe={true}
id="pf-modal-part-0"
@ -444,11 +332,12 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-disabled={false}
aria-label="Close"
className="pf-c-button pf-m-plain"
data-ouia-component-id={1}
data-ouia-component-id="OUIA-Generated-Button-plain-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
<TimesIcon
@ -472,14 +361,15 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
>
<path
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
transform=""
/>
</svg>
</TimesIcon>
</button>
</Button>
</ModalBoxCloseButton>
<ModalBoxHeader>
<ModalBoxHeader
help={null}
>
<header
className="pf-c-modal-box__header"
>
@ -564,7 +454,6 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
>
<path
d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
transform=""
/>
</svg>
</ExclamationCircleIcon>
@ -614,11 +503,12 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-disabled={false}
aria-label="Confirm delete"
className="pf-c-button pf-m-danger"
data-ouia-component-id={2}
data-ouia-component-id="OUIA-Generated-Button-danger-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
Delete
@ -633,11 +523,12 @@ exports[`<DeleteRoleConfirmationModal /> should render initially 1`] = `
aria-disabled={false}
aria-label={null}
className="pf-c-button pf-m-secondary"
data-ouia-component-id={3}
data-ouia-component-id="OUIA-Generated-Button-secondary-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
Cancel

View File

@ -34,7 +34,9 @@ exports[`<ResourceAccessListItem /> initially renders succesfully 1`] = `
>
<DataListItem
aria-labelledby="access-list-item"
className=""
id="2"
isExpanded={false}
key="2"
>
<li
@ -845,94 +847,101 @@ exports[`<ResourceAccessListItem /> initially renders succesfully 1`] = `
>
<div
className="pf-c-chip-group"
data-ouia-component-type="PF4/ChipGroup"
data-ouia-safe={true}
>
<ul
aria-label="Chip group category"
className="pf-c-chip-group__list"
role="list"
<div
className="pf-c-chip-group__main"
>
<li
className="pf-c-chip-group__list-item"
key="0"
<ul
aria-label="Chip group category"
className="pf-c-chip-group__list"
role="list"
>
<Chip
className=""
closeBtnAriaLabel="close"
component="div"
isOverflowChip={false}
isReadOnly={false}
key=".$3"
onClick={[Function]}
tooltipPosition="top"
<li
className="pf-c-chip-group__list-item"
key="0"
>
<GenerateId
prefix="pf-random-id-"
<Chip
className=""
closeBtnAriaLabel="close"
component="div"
isOverflowChip={false}
isReadOnly={false}
key=".$3"
onClick={[Function]}
tooltipPosition="top"
>
<div
className="pf-c-chip"
data-ouia-component-id={2}
data-ouia-component-type="PF4/Chip"
data-ouia-safe={true}
<GenerateId
prefix="pf-random-id-"
>
<span
className="pf-c-chip__text"
id="pf-random-id-1"
<div
className="pf-c-chip"
data-ouia-component-id="OUIA-Generated-Chip-1"
data-ouia-component-type="PF4/Chip"
data-ouia-safe={true}
>
Member
</span>
<Button
aria-label="close"
aria-labelledby="remove_pf-random-id-1 pf-random-id-1"
id="remove_pf-random-id-1"
onClick={[Function]}
variant="plain"
>
<button
aria-disabled={false}
<span
className="pf-c-chip__text"
id="pf-random-id-1"
>
Member
</span>
<Button
aria-label="close"
aria-labelledby="remove_pf-random-id-1 pf-random-id-1"
className="pf-c-button pf-m-plain"
data-ouia-component-id={3}
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
id="remove_pf-random-id-1"
onClick={[Function]}
type="button"
ouiaId="close"
variant="plain"
>
<TimesIcon
aria-hidden="true"
color="currentColor"
noVerticalAlign={false}
size="sm"
<button
aria-disabled={false}
aria-label="close"
aria-labelledby="remove_pf-random-id-1 pf-random-id-1"
className="pf-c-button pf-m-plain"
data-ouia-component-id="close"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
id="remove_pf-random-id-1"
onClick={[Function]}
role={null}
type="button"
>
<svg
<TimesIcon
aria-hidden="true"
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 352 512"
width="1em"
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<path
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
transform=""
/>
</svg>
</TimesIcon>
</button>
</Button>
</div>
</GenerateId>
</Chip>
</li>
</ul>
<svg
aria-hidden="true"
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 352 512"
width="1em"
>
<path
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
/>
</svg>
</TimesIcon>
</button>
</Button>
</div>
</GenerateId>
</Chip>
</li>
</ul>
</div>
</div>
</GenerateId>
</ChipGroup>

View File

@ -43,6 +43,7 @@ describe('<InventoryGroupAdd />', () => {
);
});
test('handleSubmit should call api', async () => {
GroupsAPI.create.mockResolvedValue({ data: {} });
await act(async () => {
wrapper.find('InventoryGroupForm').prop('handleSubmit')({
name: 'Bar',

View File

@ -57,18 +57,15 @@ describe('<InventoryRelatedGroupAdd/>', () => {
});
test('should throw error on creation of group', async () => {
GroupsAPI.create.mockRejectedValue(
new Error({
response: {
config: {
method: 'post',
url: '/api/v2/groups/',
},
data: 'An error occurred',
status: 403,
GroupsAPI.create.mockRejectedValue({
response: {
config: {
method: 'post',
url: '/api/v2/groups/',
},
})
);
data: { detail: 'An error occurred' },
},
});
await act(() =>
wrapper.find('InventoryGroupForm').prop('handleSubmit')({
name: 'foo',
@ -81,18 +78,15 @@ describe('<InventoryRelatedGroupAdd/>', () => {
test('should throw error on association of group', async () => {
GroupsAPI.create.mockResolvedValue({ data: { id: 3 } });
GroupsAPI.associateChildGroup.mockRejectedValue(
new Error({
response: {
config: {
method: 'post',
url: '/api/v2/groups/',
},
data: 'An error occurred',
status: 403,
GroupsAPI.associateChildGroup.mockRejectedValue({
response: {
config: {
method: 'post',
url: '/api/v2/groups/',
},
})
);
data: { detail: 'An error occurred' },
},
});
await act(() =>
wrapper.find('InventoryGroupForm').prop('handleSubmit')({
name: 'foo',

View File

@ -36,7 +36,15 @@ describe('<InventoryGroupForm />', () => {
handleSubmit={jest.fn()}
handleCancel={jest.fn()}
group={group}
error
error={{
response: {
config: {
method: 'post',
url: '/api/v2/groups/',
},
data: { detail: 'An error occurred' },
},
}}
/>
);
expect(newWrapper.find('FormSubmitError').length).toBe(1);

View File

@ -239,12 +239,12 @@ describe('<SurveyQuestionForm />', () => {
});
await selectType(wrapper, 'multiselect');
await act(async () =>
wrapper.find('TextArea#question-options').prop('onChange')('a \n b', {
wrapper.find('textarea#question-options').simulate('change', {
target: { value: 'a \n b', name: 'choices' },
})
);
await act(async () =>
wrapper.find('TextArea#question-default').prop('onChange')('b \n a', {
wrapper.find('textarea#question-options').simulate('change', {
target: { value: 'b \n a', name: 'default' },
})
);
@ -271,12 +271,12 @@ describe('<SurveyQuestionForm />', () => {
});
await selectType(wrapper, 'multiselect');
await act(async () =>
wrapper.find('TextArea#question-options').prop('onChange')('a \n b', {
wrapper.find('textarea#question-options').simulate('change', {
target: { value: 'a \n b', name: 'choices' },
})
);
await act(async () =>
wrapper.find('TextArea#question-default').prop('onChange')('c', {
wrapper.find('textarea#question-default').simulate('change', {
target: { value: 'c', name: 'default' },
})
);

View File

@ -27,7 +27,7 @@ describe('<LabelSelect />', () => {
);
});
expect(LabelsAPI.read).toHaveBeenCalledTimes(1);
wrapper.find('input').simulate('focus');
wrapper.find('SelectToggle').simulate('click');
const selectOptions = wrapper.find('SelectOption');
expect(selectOptions).toHaveLength(2);
expect(selectOptions.at(0).prop('value')).toEqual(options[0]);
@ -58,7 +58,7 @@ describe('<LabelSelect />', () => {
wrapper.update();
expect(LabelsAPI.read).toHaveBeenCalledTimes(2);
wrapper.find('input').simulate('focus');
wrapper.find('SelectToggle').simulate('click');
const selectOptions = wrapper.find('SelectOption');
expect(selectOptions).toHaveLength(4);
});