You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Value cannot be null, Parameter 'jsObjectReference' when using AspNetCore Title component #311
I've a problem writing test for a page which is using Microsoft.AspNetCore.Components.Web.Extensions.Head.Title component.
No issues when I remove the Title. The page looks like this:
@egil After your comment, I noticed that I've outdated bUnit. So right now I'm on bUnit 1.0.0-preview-01 and .Net Core 5.0.1.
I removed line _context.Services.AddMockJSRuntime(); as it is obsolete.
The error is different right now:
Bunit.JSRuntimeUnhandledInvocationException: 'The invocation of 'import' with the argument [./_content/Microsoft.AspNetCore.Components.Web.Extensions/headManager.js] was not expected.'
To put more light on the <Title> component. It requires <script src="_content/Microsoft.AspNetCore.Components.Web.Extensions/headManager.js"></script> in the layout file.
Activity
egil commentedon Feb 1, 2021
Hi @dawidr
Please provide the following info:
dawidr commentedon Feb 3, 2021
@egil After your comment, I noticed that I've outdated bUnit. So right now I'm on bUnit 1.0.0-preview-01 and .Net Core 5.0.1.
I removed line
_context.Services.AddMockJSRuntime();as it is obsolete.The error is different right now:
Bunit.JSRuntimeUnhandledInvocationException: 'The invocation of 'import' with the argument [./_content/Microsoft.AspNetCore.Components.Web.Extensions/headManager.js] was not expected.'To put more light on the
<Title>component. It requires<script src="_content/Microsoft.AspNetCore.Components.Web.Extensions/headManager.js"></script>in the layout file.egil commentedon Feb 3, 2021
Try settting
JSRuntimeModetoLoose, see here for more details: https://bunit.egilhansen.com/docs/test-doubles/emulating-ijsruntime.html