Closed johniwasz closed 1 year ago
That's odd, since I know the folks from Blazorise (@Megabit) use bUnit to test Blazorise with themselves 🙂
Perhaps @stsrki has a tutorial on how to get started testing components that use Blazorise components.
Ill convert this to a QA discussion.
Testing any component that that includes a component from Blazorise fails with:
System.InvalidOperationException : Cannot consume scoped service 'Microsoft.AspNetCore.Components.IComponentActivator' from singleton 'Bunit.Rendering.WebTestRenderer'.
OR:
System.InvalidOperationException : Cannot provide a value for property 'JSModule' on type 'Blazorise.Button'. There is no registered service of type 'Blazorise.Modules.IJSButtonModule'.
Example: Testing this component:
With this test:
Results in this output:
Or this test:
Results in this output:
Expected behavior:
This line results in successful instantiation of the Counter componet:
Version info:
Additional context:
A repo with a reproduction of this error can be found here:
https://github.com/johniwasz/blazorise-bunit-repro