This is a migrated thread and some comments may be shown as answers.
When bunit testing a form containing a TextArea that is hidden after submit, I get a Bunit.JSRuntimeUnhandledInvocationException
5 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 12 Feb 2021, 01:47 AM

I have a EditForm containing a TelerikTextArea wrapped in an if statement that will hide the test area after submit. This works find in browser, but using bunit I get an exception. I assume this is due to the JS library not being loaded. Do you know how to fix this?

 

 

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 12 Feb 2021, 08:48 AM

Hi Steven,

Can you confirm you have  working IJSRuntime injected (mocked with tools like JustMock or Moq, not the one that comes with bUnit), as explained here https://github.com/telerik/blazor-ui/tree/master/testing ?

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Steven
Top achievements
Rank 1
answered on 12 Feb 2021, 08:50 AM

I literally just figured it out.

 

I miss read some bunit docs that made is sound like IJsRuntime was auto injected.

 

All good now thanks!

0
Marin Bratanov
Telerik team
answered on 12 Feb 2021, 09:07 AM

I'm happy to see you move forward, Steven.

Would it be OK with you if I moved this ticket to the public forums, I think the information here might help others in the future too?

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Steven
Top achievements
Rank 1
answered on 15 Feb 2021, 12:10 AM

Hey 

 

Sure go for it.

 

Regards

Steven

0
Marin Bratanov
Telerik team
answered on 15 Feb 2021, 07:38 AM

Thank you, it's public here.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Asked by
Steven
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Steven
Top achievements
Rank 1
Share this question
or