fix(curriculum): Check if the element was conditionally rendered (#51747)

This commit is contained in:
Lasse Jørgensen
2023-10-05 11:19:30 +02:00
committed by GitHub
parent 6689a36352
commit a66ebf5e21

View File

@@ -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();