Skip to content

Testing Component Dependent on Mudblazor Components #1075

Answered by dwarwick
dwarwick asked this question in Q&A
Discussion options

You must be logged in to vote

@egil , I found the answer here. That answer is in the Mudblazor repo and as a reply to that answer, I posted my final working code.

The solution was to add the component <MudPopoverProvider /> above the component under test. See below.

UserInfoTooltipWrapper.razor

<MudPopoverProvider />
<UserInfoTooltip userId="@userId" showUserInfo="@showUserInfo" showUserInfoChanged="@showUserInfoChanged" IgnoreViewUserNamesPermission="@IgnoreViewUserNamesPermission" />

@code {
    [Parameter]
    public int userId { get; set; }

    [Parameter]
    public bool showUserInfo { get; set; }

    [Parameter]
    public EventCallback<bool> showUserInfoChanged { get; set; }

    [Parameter]
    public bool …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@dwarwick
Comment options

@egil
Comment options

egil May 18, 2023
Maintainer

Comment options

You must be logged in to vote
2 replies
@dwarwick
Comment options

Answer selected by egil
@egil
Comment options

egil May 18, 2023
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants