mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-21 01:00:49 -04:00
fix(curriculum): Check if the element was conditionally rendered (#51747)
This commit is contained in:
@@ -65,7 +65,7 @@ assert.strictEqual(
|
||||
);
|
||||
```
|
||||
|
||||
Clicking the button element should toggle the `visibility` property in state between `true` and `false`.
|
||||
Clicking the button element should toggle the `visibility` property in state between `true` and `false` and conditionally render the `h1` element.
|
||||
|
||||
```js
|
||||
(() => {
|
||||
@@ -76,11 +76,11 @@ Clicking the button element should toggle the `visibility` property in state bet
|
||||
};
|
||||
const second = () => {
|
||||
mockedComponent.find('button').simulate('click');
|
||||
return mockedComponent.state('visibility');
|
||||
return mockedComponent.state('visibility') && mockedComponent.find('h1').exists();
|
||||
};
|
||||
const third = () => {
|
||||
mockedComponent.find('button').simulate('click');
|
||||
return mockedComponent.state('visibility');
|
||||
return mockedComponent.state('visibility') && mockedComponent.find('h1').exists();
|
||||
};
|
||||
const firstValue = first();
|
||||
const secondValue = second();
|
||||
|
||||
Reference in New Issue
Block a user