Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
maier49 committed Jun 8, 2020
1 parent b5cfb2d commit e8bdab6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/testing/unit/assertion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('new/assertion', () => {
<div>
<AWidget>
{{
foo: () => <WrappedDiv>child</WrappedDiv>
foo: () => [<WrappedDiv>child</WrappedDiv>]
}}
</AWidget>
</div>
Expand Down Expand Up @@ -215,12 +215,15 @@ describe('new/assertion', () => {
});

it('can set a child of a functional child widget', () => {
const AWidget = create().children<{ foo(): RenderResult }>()(({ children }) => (
<div>{children()[0].foo()}</div>
const AWidget = create().children<{ bar: RenderResult; foo(): RenderResult }>()(({ children }) => (
<div>
{children()[0].foo()}
{children()[0].bar}
</div>
));
const ParentWidget = create()(() => (
<div>
<AWidget>{{ foo: () => <div>bar</div> }}</AWidget>
<AWidget>{{ foo: () => <div>bar</div>, bar: <div>foo</div> }}</AWidget>
</div>
));
const WrappedWidget = wrap(AWidget);
Expand All @@ -231,7 +234,8 @@ describe('new/assertion', () => {
<div>
<WrappedWidget>
{{
foo: () => <WrappedDiv>foo</WrappedDiv>
foo: () => <WrappedDiv>foo</WrappedDiv>,
bar: <div>foo</div>
}}
</WrappedWidget>
</div>
Expand Down

0 comments on commit e8bdab6

Please sign in to comment.