diff --git a/challenges/03-front-end-libraries/react.json b/challenges/03-front-end-libraries/react.json index c7707f1534..33ae46eda9 100644 --- a/challenges/03-front-end-libraries/react.json +++ b/challenges/03-front-end-libraries/react.json @@ -2575,7 +2575,7 @@ "text": "The h1 tag should render the activeUsers value from MyComponent's state.", "testString": - "async () => { const waitForIt = (fn) => new Promise((resolve, reject) => setTimeout(() => resolve(fn()), 250)); const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ activeUsers: 1237 }); return waitForIt(() => mockedComponent.find('h1').text()); }; const second = () => { mockedComponent.setState({ activeUsers: 1000 }); return waitForIt(() => mockedComponent.find('h1').text()); }; const firstValue = await first(); const secondValue = await second(); assert(new RegExp('1237').test(firstValue) && new RegExp('1000').test(secondValue), 'The h1 tag should render the activeUsers value from MyComponent's state.'); }; " + "async () => { const mockedComponent = Enzyme.mount(React.createElement(MyComponent)); const first = () => { mockedComponent.setState({ activeUsers: 1237 }); return mockedComponent.find('h1').text(); }; const second = () => { mockedComponent.setState({ activeUsers: 1000 }); return mockedComponent.find('h1').text(); }; assert(new RegExp('1237').test(first()) && new RegExp('1000').test(second()), 'The h1 tag should render the activeUsers value from MyComponent's state.'); }; " } ], "solutions": [