TypesOfFruit
and Fruits
. Take the TypesOfFruit
component and compose it, or nest it, within the Fruits
component. Then take the Fruits
component and nest it within the TypesOfFood
component. The result should be a child component, nested within a parent component, which is nested within a parent component of its own!
TypesOfFood
component should return a single div
element.
testString: 'assert(Enzyme.shallow(React.createElement(TypesOfFood)).type() === ''div'', ''The TypesOfFood
component should return a single div
element.'');'
- text: The TypesOfFood
component should return the Fruits
component.
testString: 'assert(Enzyme.shallow(React.createElement(TypesOfFood)).props().children[1].type.name === ''Fruits'', ''The TypesOfFood
component should return the Fruits
component.'');'
- text: The Fruits
component should return the TypesOfFruit
component.
testString: 'assert(Enzyme.mount(React.createElement(TypesOfFood)).find(''h2'').html() === ''Fruits
component should return the TypesOfFruit
component.'');'
- text: The TypesOfFruit
component should return the h2
and ul
elements.
testString: 'assert(Enzyme.mount(React.createElement(TypesOfFood)).find(''ul'').text() === ''ApplesBlueberriesStrawberriesBananas'', ''The TypesOfFruit
component should return the h2
and ul
elements.'');'
```