System.InvalidOperationException : The render handle is not yet assigned. #476
Replies: 3 comments 5 replies
-
Hi @Alessandro2212, Can you share the exception message (stack trace alone is not useful :))? |
Beta Was this translation helpful? Give feedback.
-
Hi @egil
Thanks for your update, it is perfectly fine the next weekend too
Il Dom 15 Ago 2021, 12:56 Egil Hansen ***@***.***> ha scritto:
… Hi @Alessandro2212 <https://github.com/Alessandro2212>, weekend does not
seem to turn out as I hope. Hopefully I will have time to look at this next
week!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#476 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJLEH57G6TQ5X7Y33XE7MTT46MMVANCNFSM5B4BQVXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Beta Was this translation helpful? Give feedback.
-
OK, I had a look at the code, and it happens because you are calling
A few other observations from looking at your code:
So instead of doing this in your test ctor: testContext = new TestContext();
testContext.Services
.AddBlazorise(options =>
{
options.ChangeTextOnKeyPress = true;
})... just do this: ```c#
Services
.AddBlazorise(options =>
{
options.ChangeTextOnKeyPress = true;
})... And in your test methods, dont do: using var ctx = testContext;
var cut = ctx.RenderComponent<...> just do this: var cut = RenderComponent<...> See more about this at https://bunit.dev/docs/getting-started/writing-tests.html#remove-boilerplate-code-from-tests-1
Hope this helps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am getting an exception when trying to render my component with bunit.
The component I'm trying to render has a nested component to render, and when the nested component's OnParametersSetAsync() is completed, I get that exception.
There is a two-way binding on the nested component's parameter, and when that parameter changes the "mother" component's view model gets notified and triggers StateHasChange().
this is the "mother" component (OfferTypeComponent) razor code:
this is the nested component (InvoiceTextSelectorComponent) razor.cs code:
this is the unit test triggering the excp:
Any help/suggestion ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions