Skip to content

Add support for Blazors <InputFile> component #317

@egil

Description

@egil

Render a component with the <InputFile> component inside requires additional set up, that bUnit should provide out of the box.

The current solution is to provide a mock of a IOptions<RemoteBrowserFileStreamOptions> and configure the JSInterop to handle the <InputFile> components JSInterop invocation. E.g.

var optionsMock = Substitute.For<IOptions<RemoteBrowserFileStreamOptions>>();
Services.AddSingleton<IOptions<RemoteBrowserFileStreamOptions>>(optionsMock);
JSInterop.SetupVoid("Blazor._internal.InputFile.init", x => true);

This will allow the component to render, but additional steps might be needed to test the "input" part of the component.

Related: #314

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinvestigateThis issue require further investigation before closing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions