Skip to content

Commit

Permalink
Unit test enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara4994 committed Jul 3, 2023
1 parent d0b3b8d commit 25fe405
Show file tree
Hide file tree
Showing 40 changed files with 6,459 additions and 12,154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@ exports[`EmbeddedCloudEventForm tests Snapshot - defaultValue 1`] = `
}
targetOrigin="origin"
>
<ForwardRef>
<ForwardRef(RefForwardingEmbeddedEnvelope)
apiImpl={
EmbeddedCloudEventFormChannelApiImpl {
"driver": Object {
"triggerCloudEvent": [MockFunction],
},
}
}
config={
Object {
"containerType": "div",
}
}
origin="origin"
pollInit={[Function]}
refDelegate={[Function]}
>
<div />
</ForwardRef>
</ForwardRef(RefForwardingEmbeddedEnvelope)>
</ForwardRef>
`;

Expand All @@ -31,9 +47,25 @@ exports[`EmbeddedCloudEventForm tests Snapshot - isNewInstanceEvent 1`] = `
isNewInstanceEvent={true}
targetOrigin="origin"
>
<ForwardRef>
<ForwardRef(RefForwardingEmbeddedEnvelope)
apiImpl={
EmbeddedCloudEventFormChannelApiImpl {
"driver": Object {
"triggerCloudEvent": [MockFunction],
},
}
}
config={
Object {
"containerType": "div",
}
}
origin="origin"
pollInit={[Function]}
refDelegate={[Function]}
>
<div />
</ForwardRef>
</ForwardRef(RefForwardingEmbeddedEnvelope)>
</ForwardRef>
`;

Expand All @@ -46,8 +78,24 @@ exports[`EmbeddedCloudEventForm tests Snapshot 1`] = `
}
targetOrigin="origin"
>
<ForwardRef>
<ForwardRef(RefForwardingEmbeddedEnvelope)
apiImpl={
EmbeddedCloudEventFormChannelApiImpl {
"driver": Object {
"triggerCloudEvent": [MockFunction],
},
}
}
config={
Object {
"containerType": "div",
}
}
origin="origin"
pollInit={[Function]}
refDelegate={[Function]}
>
<div />
</ForwardRef>
</ForwardRef(RefForwardingEmbeddedEnvelope)>
</ForwardRef>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ function addHeader(

if (header && valueField) {
act(() => {
headerField.props().onChange(header);
valueField.props().onChange(headerValue);
headerField.at(0).props().onChange(header);
valueField.at(0).props().onChange(headerValue);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,62 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onClick={[Function]}
variant="link"
>
<MockedComponent />
<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>
</Button>
</div>
</StackItem>
Expand Down Expand Up @@ -85,7 +140,41 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onChange={[Function]}
value="key"
>
<MockedComponent />
<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>
</TextInput>
</div>
</GridItem>
Expand All @@ -101,7 +190,39 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onChange={[Function]}
value="value"
>
<MockedComponent />
<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>
</TextInput>
</div>
</GridItem>
Expand All @@ -118,7 +239,50 @@ exports[`CloudEventCustomHeadersEditor tests Add headers 1`] = `
onClick={[Function]}
variant="plain"
>
<MockedComponent />
<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>
</Button>
</div>
</GridItem>
Expand Down Expand Up @@ -161,7 +325,62 @@ exports[`CloudEventCustomHeadersEditor tests Snapshot - empty 1`] = `
onClick={[Function]}
variant="link"
>
<MockedComponent />
<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>
</Button>
</div>
</StackItem>
Expand Down
Loading

0 comments on commit 25fe405

Please sign in to comment.