Fruits
Vegetables
لك وراء الكواليس. تقديم كل من المكونات كأطفال من المكون TypesOfFood
، ثم تقديم TypesOfFood
إلى DOM. يوجد div
به id='challenge-node'
متاح للاستخدام. TypesOfFood
component should return a single div
element.");'
- text: يجب أن يقوم المكون TypesOfFood
مكون Fruits
بعد عنصر h1
.
testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === "Fruits"; })(), "The TypesOfFood
component should render the Fruits
component after the h1
element.");'
- text: ''
testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === "Vegetables"; })(), "The TypesOfFood
component should render the Vegetables
component after Fruits
.");'
- text: يجب أن يتم عرض المكون TypesOfFood
إلى DOM داخل div
مع challenge-node
الهوية.
testString: 'assert((function() { const html = document.getElementById("challenge-node").childNodes[0].innerHTML; return (html === "TypesOfFood
component should render to the DOM within the div
with the id challenge-node
.");'
```