From 1789f9da0a574fb0ef6fc2e617eb8135321e2be1 Mon Sep 17 00:00:00 2001 From: Nguyen Quoc Bao Date: Thu, 15 Feb 2018 01:50:38 +0800 Subject: [PATCH] fix(seed): Add length check for component find (#16678) Closes #16677 fix(seed): Use triple equal --- seed/challenges/03-front-end-libraries/react.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/03-front-end-libraries/react.json b/seed/challenges/03-front-end-libraries/react.json index 81c6a572428..ed2ea3e868f 100644 --- a/seed/challenges/03-front-end-libraries/react.json +++ b/seed/challenges/03-front-end-libraries/react.json @@ -590,7 +590,7 @@ "tests": [ "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === 'div'; })(), 'message: The TypesOfFood component should return a single div element.');", "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === 'Fruits'; })(), 'message: The TypesOfFood component should return the Fruits 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 Fruits component should return the NonCitrus component and the Citrus 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 Fruits component should return the NonCitrus component and the Citrus component.');", "assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === 'Vegetables'; })(), 'message: The TypesOfFood component should return the Vegetables component below the Fruits component.');" ], "solutions": [