Skip to content

Handling a click event at the location of a child element #1497

Answered by linkdotnet
danielchalmers asked this question in Q&A
Discussion options

You must be logged in to vote

That is a very good question. Given the more "integration" nature of the test, I'm leaning towards the fact that using bUnit for that specific instance doesn't help you much.

Whatever you do (as you emulate and set up all JS interop) will most likely result in testing the test code (your JS Mock setup).
The obvious candidate would be something like Playwright/Cypress/... but that would be an entire new approach as far as I could see in MudBlazor's codebase.

Another approach might be to introduce an humble object that does the JS interop:

public interface IClockJsInterop
{
    Task<int> GetStickValueAsync(ElementReference clockElement, double clientX, double clientY);
}

Which you could set:

Replies: 1 comment 2 replies

Comment options

linkdotnet
Jul 8, 2024
Maintainer Sponsor

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

@linkdotnet
Comment options

linkdotnet Jul 9, 2024
Maintainer Sponsor

Answer selected by danielchalmers
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