-
I have a method which basically looks like this:
Is there a way to test that the StateHasChanged method has been called in this method? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @MiBuena Not directly. But hopefully you are not triggering a render through StateHasChanged without that render changing the render tree, so I would use the usual ways to see if the spinner (im guessing) is now showing, e.g. by using the If you really need to just see that a render has occurred, you can inspect the Hope this is helpful, Egil. |
Beta Was this translation helpful? Give feedback.
Hi @MiBuena
Not directly. But hopefully you are not triggering a render through StateHasChanged without that render changing the render tree, so I would use the usual ways to see if the spinner (im guessing) is now showing, e.g. by using the
cut.Find("css selector that finds the spinner")
.If you really need to just see that a render has occurred, you can inspect the
cut.RenderCount
property, which will increment each time the component under test renders.Hope this is helpful, Egil.