fix(seed): Add length check for component find (#16678)

Closes #16677

fix(seed): Use triple equal
pull/16670/merge
Nguyen Quoc Bao 2018-02-15 01:50:38 +08:00 committed by Stuart Taylor
parent 09689be107
commit 1789f9da0a
1 changed files with 1 additions and 1 deletions

View File

@ -590,7 +590,7 @@
"tests": [ "tests": [
"assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === 'div'; })(), 'message: The <code>TypesOfFood</code> component should return a single <code>div</code> element.');", "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === 'div'; })(), 'message: The <code>TypesOfFood</code> component should return a single <code>div</code> element.');",
"assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === 'Fruits'; })(), 'message: The <code>TypesOfFood</code> component should return the <code>Fruits</code> component.');", "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === 'Fruits'; })(), 'message: The <code>TypesOfFood</code> component should return the <code>Fruits</code> component.');",
"assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return (mockedComponent.find('Fruits').children().find('NonCitrus') && mockedComponent.find('Fruits').children().find('Citrus')); })(), 'message: The <code>Fruits</code> component should return the <code>NonCitrus</code> component and the <code>Citrus</code> component.');", "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); })(), 'message: The <code>Fruits</code> component should return the <code>NonCitrus</code> component and the <code>Citrus</code> component.');",
"assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === 'Vegetables'; })(), 'message: The <code>TypesOfFood</code> component should return the <code>Vegetables</code> component below the <code>Fruits</code> component.');" "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === 'Vegetables'; })(), 'message: The <code>TypesOfFood</code> component should return the <code>Vegetables</code> component below the <code>Fruits</code> component.');"
], ],
"solutions": [ "solutions": [