From 07e665052db4724a4fb45f820722d8186ba5dbe5 Mon Sep 17 00:00:00 2001 From: Himanshu maurya Date: Sat, 18 Jul 2020 01:41:16 +0530 Subject: [PATCH] Fixed-pass-an-array-as-props (#39268) * Fixed-pass-an-arrays-props * Fixed:pass-an-array-as-props2 * Update curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Update curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Update curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> --- .../react/pass-an-array-as-props.english.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md b/curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md index 27f783065d..79fc1bc713 100644 --- a/curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md +++ b/curriculum/challenges/english/03-front-end-libraries/react/pass-an-array-as-props.english.md @@ -47,7 +47,14 @@ tests: - text: The second List component representing the tasks for tomorrow should have 3 or more items. testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.find('List').get(1).props.tasks.length >= 3; })()); - text: The List component should render the value from the tasks prop in the p tag. - testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(ToDo)); return mockedComponent.find('p').get(0).props.children === mockedComponent.find('List').get(0).props.tasks.join(', ') && mockedComponent.find('p').get(1).props.children === mockedComponent.find('List').get(1).props.tasks.join(', '); })()); + testString: | + assert((function() { + const mockedComponent = Enzyme.mount(React.createElement(ToDo)); + return ( + mockedComponent.find('p').get(0).props.children.replace(/\s*,\s*/g,',') === mockedComponent.find('List').get(0).props.tasks.join(',').replace(/\s*,\s*/g,',') && + mockedComponent.find('p').get(1).props.children.replace(/\s*,\s*/g,',') === mockedComponent.find('List').get(1).props.tasks.join(',').replace(/\s*,\s*/g,',') + ); + })()); ```