From 4d1d89b1c798b13d3e0883fbca270527cb2a5b3b Mon Sep 17 00:00:00 2001
From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
Date: Mon, 18 Mar 2019 22:00:12 -0700
Subject: [PATCH] fix(curriculum) Fixed test to only allow valid JSX comments
for Add Comments In JSX challenge (#35320)
* fix: only allow valid jsx comments in div elem
* fix: allow blank comment and removed assert msgs
---
.../react/add-comments-in-jsx.english.md | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
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(/