Repository navigation
|
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? |
Answered by
egil
Oct 5, 2020
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. |
1 reply
Answer selected by
MiBuena
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.RenderCountproperty, which will increment each time the component under test renders.Hope this is helpful, Egil.