Skip to content

Commit

Permalink
Extended fragment test to also render a string component
Browse files Browse the repository at this point in the history
  • Loading branch information
tobilen committed Oct 1, 2017
1 parent 9022b85 commit a4673cf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,21 @@ describe('FlipMove', () => {
{ id: 'c', name: 'This Just Happened', timestamp: 654321 },
];

const ListItemString = ({ name }) => name;

// We need a list item, the thing we'll be moving about.
// eslint-disable-next-line react/prefer-stateless-function
const ListItem = class ListItem extends Component {
render() {
return <li id={this.props.id}>{this.props.name}</li>;
return (
<li id={this.props.id}>
{this.props.useString ? (
<ListItemString name={this.props.name} />
) : (
this.props.name
)}
</li>
);
}
};

Expand All @@ -55,6 +65,7 @@ describe('FlipMove', () => {
key={article ? article.id : null}
id={article ? article.id : null}
name={article ? article.name : null}
useString
/>
));
}
Expand Down

0 comments on commit a4673cf

Please sign in to comment.