You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write a Unit test of Fluent UI Modal using JEST in react. However it seems like the container object returned by render function, against matching a snapshot contains an empty DIV of the modal.
It renders something like
<div>
<span
class="ms-layer"
/>
</div>
However i can see the Modal rendered if i query either using document.body or screen object of Jest.
I am using Merged Styles to apply the CSS to modal and one of the css property is sent to CSS class as a prop. However even the screen objet returns the Modal with the inital CSS and not the re-render that happens automatically that injects the correct css param.
Question:
How can i assert on the Container to make sure that it has the latest document.body?
How can i wait for All re-renders to finish and have the latest reference?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
I am trying to write a Unit test of Fluent UI Modal using JEST in react. However it seems like the
container
object returned byrender
function, against matching a snapshot contains an empty DIV of the modal.It renders something like
However i can see the Modal rendered if i query either using
document.body
orscreen
object of Jest.I am using Merged Styles to apply the CSS to modal and one of the css property is sent to CSS class as a prop. However even the screen objet returns the Modal with the inital CSS and not the re-render that happens automatically that injects the correct css param.
Question:
Beta Was this translation helpful? Give feedback.
All reactions