Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
chore(typescript): add tests for null and false children
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke John authored and Luke John committed Jan 8, 2018
1 parent 7912617 commit 4a1598c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/glamorous.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,37 @@ const BuiltinStyledWithMultipleChild: JSX.Element = (
<glamorous.Span>world!</glamorous.Span>
</glamorous.Div>
);

const CustomStatelessComponent: React.SFC<{}> = (_props) => <div />
class CustomClassComponent extends React.Component<{}, {}> {
render() {
return null
}
}
const CustomGlamorousComponent = glamorous.div()
const CustomGlamorousComponent2 = glamorous('div')()
const CustomGlamorousComponent3 = glamorous(CustomGlamorousComponent)()
const BuiltinStyledComponentChildren: JSX.Element = (
<glamorous.Div height={18}>
<CustomStatelessComponent />
<CustomClassComponent />
<CustomGlamorousComponent />
<CustomGlamorousComponent2 />
<CustomGlamorousComponent3 />
</glamorous.Div>
)
const BuiltinStyledWithPrimitivesChildren: JSX.Element = (
<glamorous.Div color='red'>
{null}
{false}
{true}
{undefined}
{5}
</glamorous.Div>
);

const BuiltinStyledWithFragment: JSX.Element = (
<glamorous.Div color='red'>
<React.Fragment />
</glamorous.Div>
);

0 comments on commit 4a1598c

Please sign in to comment.