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
The motivation behind is to have a "valid" argument passed down which behaves like Blazor would in a "real" scenario (detail = 1 for example for Click and detail = 2 for DoubleClick).
Proposed Solution
bUnit already offers an overload which takes the MouseEventArgs. This decouples bUnit from the supported .NET versions. For example in .net5 OffsetX and OffsetY was introduced. In .net6 PageX and PageY was introduced. Thus this "simple" version just works.
Furthermore the suggestion would be to delete Click and DoubleClick with all it's overloads and just offer 2 versions:
publicvoidClick(thisIElementelement,MouseEventArgsmouseEventArgs);// Already existspublicvoidClick(thisIElementelement)=> Click(element,new MouseEventArgs {detail=1});// New one to be in line with Blazor
In any way a small migration guide should be added to the docs.
Advantages:
If Microsoft extends that class we don't have to do anything (you could also argue that is a bad thing)
In my opinion more readable than n parameters. Also documentation for free from Microsoft
Also more cohesive as a lot of the default parameters are often times not used
ClickAsync which is also public does use the MouseEventArgs. That seems a bit in-cohesive as well. Normal expectation is that the sync and async version have the same parameter (except maybe CancellationToken or similar stuff)
Current Situation
The current state offers multiple overloads with a dozen of properties which are mapped one to one to the
MouseEventArgs
:The motivation behind is to have a "valid" argument passed down which behaves like Blazor would in a "real" scenario (
detail = 1
for example forClick
anddetail = 2
forDoubleClick
).Proposed Solution
bUnit already offers an overload which takes the
MouseEventArgs
. This decouples bUnit from the supported .NET versions. For example in .net5OffsetX
andOffsetY
was introduced. In .net6PageX
andPageY
was introduced. Thus this "simple" version just works.Furthermore the suggestion would be to delete
Click
andDoubleClick
with all it's overloads and just offer 2 versions:In any way a small migration guide should be added to the docs.
Advantages:
ClickAsync
which is also public does use theMouseEventArgs
. That seems a bit in-cohesive as well. Normal expectation is that the sync and async version have the same parameter (except maybeCancellationToken
or similar stuff)Disadvantages:
The text was updated successfully, but these errors were encountered: