Replies: 1 comment
-
The problem is probably solved by moving to the AntDesign test context. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My unit test in C# failing with this message:
System.NullReferenceException : Object reference not set to an instance of an object.
at AntDesign.Select
2.SetDropdownStyleAsync() at AntDesign.Select
2.OnAfterRenderAsync(Boolean firstRender)My component code:
<SimpleSelect DefaultValue="@(_selectedLanguage)" Style="width: 60px; margin-left: 10px" OnSelectedItemChanged="HandleChangeLanguage"> <SelectOptions> <SimpleSelectOption Value="de-DE" Label="DE"></SimpleSelectOption> <SimpleSelectOption Value="cs-CZ" Label="CZ"></SimpleSelectOption> <SimpleSelectOption Value="en-US" Label="EN"></SimpleSelectOption> </SelectOptions> </SimpleSelect>
After build the App is normaly function. But on nUnit test with bUnit package failing over render this Component.... rest of component no problem. When comment this Simpleselect code then unit test is ok.
extract from unit test code:
var target = testContext.RenderComponent<MainLayout>();
When change AntDesign SimpleSelect to classic HTML select then unit test is ok - no error.
How to solve it?
Beta Was this translation helpful? Give feedback.
All reactions