diff --git a/curriculum/challenges/english/03-front-end-libraries/react/add-comments-in-jsx.english.md b/curriculum/challenges/english/03-front-end-libraries/react/add-comments-in-jsx.english.md index 3e0efdad20..11f737b698 100644 --- a/curriculum/challenges/english/03-front-end-libraries/react/add-comments-in-jsx.english.md +++ b/curriculum/challenges/english/03-front-end-libraries/react/add-comments-in-jsx.english.md @@ -22,14 +22,15 @@ The code editor has a JSX element similar to what you created in the last challe ```yml tests: - text: The constant JSX should return a div element. - testString: assert(JSX.type === 'div', 'The constant JSX should return a div 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', 'The div should contain a p tag as the second element.'); - - text: The JSX should include a comment. - testString: getUserInput => assert(getUserInput('index').includes('/*') && getUserInput('index').includes('*/'), 'The JSX should include a comment.'); - + testString: assert(JSX.props.children[1].type === 'p'); + - text: The existing h1 and p elements should not be modified. + testString: assert(JSX.props.children[0].props.children === 'This is a block of JSX' && JSX.props.children[1].props.children === 'Here\'s a subtitle'); + - text: The JSX should use valid comment syntax. + testString: assert(/
[\s\S]*{\s*\/\*[\s\S]*\*\/\s*}[\s\S]*<\/div>/.test(code)); ```