--- id: 5a24c314108439a4d4036166 title: Compose React Components challengeType: 6 isRequired: false videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === "div"; })(), "The TypesOfFood component should return a single div element.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === "Fruits"; })(), "The TypesOfFood component should return the Fruits component.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return (mockedComponent.find("Fruits").children().find("NonCitrus").length === 1 && mockedComponent.find("Fruits").children().find("Citrus").length === 1); })(), "The Fruits component should return the NonCitrus component and the Citrus component.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === "Vegetables"; })(), "The TypesOfFood component should return the Vegetables component below the Fruits component.");' ```
## Challenge Seed
```jsx class Fruits extends React.Component { constructor(props) { super(props); } render() { return (

Fruits:

{ /* change code below this line */ } { /* change code above this line */ }
); } }; class TypesOfFood extends React.Component { constructor(props) { super(props); } render() { return (

Types of Food:

{ /* change code below this line */ } { /* change code above this line */ }
); } }; ```
### Before Test
```jsx class NonCitrus extends React.Component { render() { return (

Non-Citrus:

  • Apples
  • Blueberries
  • Strawberries
  • Bananas
); } }; class Citrus extends React.Component { render() { return (

Citrus:

  • Lemon
  • Lime
  • Orange
  • Grapefruit
); } }; class Vegetables extends React.Component { render() { return (

Vegetables:

  • Brussel Sprouts
  • Broccoli
  • Squash
); } }; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```