From 394ae3d1ce107f668157b6c22837616593d877e8 Mon Sep 17 00:00:00 2001 From: lasjorg <28780271+lasjorg@users.noreply.github.com> Date: Wed, 10 Apr 2019 17:22:37 +0200 Subject: [PATCH] fix(challenge): check for li and specify elements accepting text (#35193) * fix(challenge): check for li and specify elements accepting text * fix(challenge): revert text * fix(challenge): remove word added by mistake * fix(challenge): update test, cleanup assertion text --- .../react/create-a-complex-jsx-element.english.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/curriculum/challenges/english/03-front-end-libraries/react/create-a-complex-jsx-element.english.md b/curriculum/challenges/english/03-front-end-libraries/react/create-a-complex-jsx-element.english.md index 59f9f2bef7..2828fd35df 100644 --- a/curriculum/challenges/english/03-front-end-libraries/react/create-a-complex-jsx-element.english.md +++ b/curriculum/challenges/english/03-front-end-libraries/react/create-a-complex-jsx-element.english.md @@ -31,15 +31,15 @@ An h1, a p, and an unordered list that contains three ```yml tests: - text: The constant JSX should return a div element. - testString: assert(JSX.type === 'div', 'The constant JSX should return a div element.'); - - text: The div should contain a p tag as the second element. - testString: assert(JSX.props.children[1].type === 'p', 'The div should contain a p tag as the second element.'); - - text: The div should contain a ul tag as the third element. - testString: assert(JSX.props.children[2].type === 'ul', 'The div should contain a ul tag as the third element.'); + testString: assert(JSX.type === 'div'); - text: The div should contain an h1 tag as the first element. - testString: assert(JSX.props.children[0].type === 'h1', 'The div should contain an h1 tag as the first element.'); + testString: assert(JSX.props.children[0].type === 'h1'); + - text: The div should contain a p tag as the second element. + testString: assert(JSX.props.children[1].type === 'p'); + - text: The div should contain a ul tag as the third element. + testString: assert(JSX.props.children[2].type === 'ul'); - text: The ul should contain three li elements. - testString: assert(JSX.props.children[2].props.children.length === 3, 'The ul should contain three li elements.'); + testString: assert(JSX.props.children.filter(ele => ele.type === 'ul')[0].props.children.filter(ele => ele.type === 'li').length === 3); ```