Skip to content

Commit

Permalink
Snapshots cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara4994 committed Jul 6, 2023
1 parent b18443b commit c060764
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 2,296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,38 @@ const MockedComponent = (): React.ReactElement => {
return <></>;
};

jest.mock('@patternfly/react-core', () =>
jest.mock('@patternfly/react-core/dist/js/components/Button', () =>
Object.assign({}, jest.requireActual('@patternfly/react-core'), {
Button: () => {
return <MockedComponent />;
},
}
})
);

jest.mock('@patternfly/react-core/dist/js/components/TextInput', () =>
Object.assign({}, jest.requireActual('@patternfly/react-core'), {
TextInput: () => {
return <MockedComponent />;
}
})
);

jest.mock('@patternfly/react-icons', () =>
jest.mock('@patternfly/react-icons/dist/esm/icons/plus-circle-icon', () =>
Object.assign({}, jest.requireActual('@patternfly/react-icons'), {
TrashIcon: () => {
return <MockedComponent />;
},
PlusCircleIcon: () => {
return <MockedComponent />;
}
})
);

jest.mock('@patternfly/react-icons/dist/esm/icons/trash-icon', () =>
Object.assign({}, jest.requireActual('@patternfly/react-icons'), {
TrashIcon: () => {
return <MockedComponent />;
}
})
);

function addHeader(
wrapper,
index: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,74 +17,13 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
className="pf-l-stack__item"
>
<Button
icon={
<PlusCircleIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
}
icon={<UNDEFINED />}
isInline={true}
key="add-header-button"
onClick={[Function]}
variant="link"
>
<ButtonBase
icon={
<PlusCircleIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
}
innerRef={null}
isInline={true}
onClick={[Function]}
variant="link"
>
<button
aria-disabled={false}
aria-label={null}
className="pf-c-button pf-m-link pf-m-inline"
data-ouia-component-id="OUIA-Generated-Button-link-2"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
<span
className="pf-c-button__icon pf-m-start"
>
<PlusCircleIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 512 512"
width="1em"
>
<path
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"
/>
</svg>
</PlusCircleIcon>
</span>
Add Header
</button>
</ButtonBase>
<MockedComponent />
</Button>
</div>
</StackItem>
Expand Down Expand Up @@ -140,41 +79,7 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onChange={[Function]}
value="key"
>
<TextInputBase
aria-label={null}
autoFocus={false}
className=""
id="header-key-0-input"
innerRef={null}
isDisabled={false}
isIconSprite={false}
isLeftTruncated={false}
isReadOnly={false}
isRequired={false}
onChange={[Function]}
ouiaSafe={true}
type="text"
validated="default"
value="key"
>
<input
aria-invalid={false}
aria-label={null}
autoFocus={false}
className="pf-c-form-control"
data-ouia-component-id="OUIA-Generated-TextInputBase-1"
data-ouia-component-type="PF4/TextInput"
data-ouia-safe={true}
disabled={false}
id="header-key-0-input"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={false}
type="text"
value="key"
/>
</TextInputBase>
<MockedComponent />
</TextInput>
</div>
</GridItem>
Expand All @@ -190,39 +95,7 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onChange={[Function]}
value="value"
>
<TextInputBase
aria-label={null}
className=""
id="header-value-0-input"
innerRef={null}
isDisabled={false}
isIconSprite={false}
isLeftTruncated={false}
isReadOnly={false}
isRequired={false}
onChange={[Function]}
ouiaSafe={true}
type="text"
validated="default"
value="value"
>
<input
aria-invalid={false}
aria-label={null}
className="pf-c-form-control"
data-ouia-component-id="OUIA-Generated-TextInputBase-2"
data-ouia-component-type="PF4/TextInput"
data-ouia-safe={true}
disabled={false}
id="header-value-0-input"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={false}
type="text"
value="value"
/>
</TextInputBase>
<MockedComponent />
</TextInput>
</div>
</GridItem>
Expand All @@ -239,50 +112,7 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onClick={[Function]}
variant="plain"
>
<ButtonBase
aria-label="delete"
innerRef={null}
onClick={[Function]}
variant="plain"
>
<button
aria-disabled={false}
aria-label="delete"
className="pf-c-button pf-m-plain"
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"
>
<TrashIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 448 512"
width="1em"
>
<path
d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"
/>
</svg>
</TrashIcon>
</button>
</ButtonBase>
<MockedComponent />
</Button>
</div>
</GridItem>
Expand Down Expand Up @@ -313,74 +143,13 @@ exports[`CloudEventCustomHeadersEditor tests Snapshot - empty 1`] = `
className="pf-l-stack__item"
>
<Button
icon={
<PlusCircleIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
}
icon={<UNDEFINED />}
isInline={true}
key="add-header-button"
onClick={[Function]}
variant="link"
>
<ButtonBase
icon={
<PlusCircleIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
/>
}
innerRef={null}
isInline={true}
onClick={[Function]}
variant="link"
>
<button
aria-disabled={false}
aria-label={null}
className="pf-c-button pf-m-link pf-m-inline"
data-ouia-component-id="OUIA-Generated-Button-link-1"
data-ouia-component-type="PF4/Button"
data-ouia-safe={true}
disabled={false}
onClick={[Function]}
role={null}
type="button"
>
<span
className="pf-c-button__icon pf-m-start"
>
<PlusCircleIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
>
<svg
aria-hidden={true}
aria-labelledby={null}
fill="currentColor"
height="1em"
role="img"
style={
Object {
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 512 512"
width="1em"
>
<path
d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"
/>
</svg>
</PlusCircleIcon>
</span>
Add Header
</button>
</ButtonBase>
<MockedComponent />
</Button>
</div>
</StackItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const MockedComponent = (): React.ReactElement => {
return <></>;
};

jest.mock('@patternfly/react-icons', () =>
jest.mock('@patternfly/react-icons/dist/esm/icons/help-icon', () =>
Object.assign({}, jest.requireActual('@patternfly/react-icons'), {
HelpIcon: () => {
return <MockedComponent />;
}
})
);

jest.mock('@patternfly/react-core', () =>
jest.mock('@patternfly/react-core/dist/js/components/Popover', () =>
Object.assign({}, jest.requireActual('@patternfly/react-icons'), {
Popover: () => {
return <MockedComponent />;
Expand Down
Loading

0 comments on commit c060764

Please sign in to comment.