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 59f9f2bef7f..2828fd35df7 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); ```