-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(cdk/testing): The UnitTestElements.hover() does not trigger a mouseover event #24486
Closed
1 task
Labels
area: cdk/testing
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
TimothyGillespie
added
the
needs triage
This issue needs to be triaged by the team
label
Feb 26, 2022
TimothyGillespie
changed the title
cdk/testing: The UnitTestElements.hover() does not trigger a mouseover event
bug(cdk/testing): The UnitTestElements.hover() does not trigger a mouseover event
Feb 26, 2022
crisbeto
added
area: cdk/testing
has pr
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
and removed
needs triage
This issue needs to be triaged by the team
labels
Feb 28, 2022
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Feb 28, 2022
…lement Fixes that the `UnitTestElement` wasn't dispatching `mouseover` and `mouseout` on `hover`/`mouseAway` like the browser would. Fixes angular#24486.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Feb 28, 2022
…lement Fixes that the `UnitTestElement` wasn't dispatching `mouseover` and `mouseout` on `hover`/`mouseAway` like the browser would. Fixes angular#24486.
forsti0506
pushed a commit
to forsti0506/components
that referenced
this issue
Apr 3, 2022
…lement (angular#24490) Fixes that the `UnitTestElement` wasn't dispatching `mouseover` and `mouseout` on `hover`/`mouseAway` like the browser would. Fixes angular#24486.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: cdk/testing
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Currently, the
UnitTestElement
would trigger a mouseenter event but not a mouseover event. This is unexpected since a mouseover should always trigger alongside a mouseenter. I noticed this when I wrote a harness for a component depending on the mouseover event, and thus required a workaround.I would gladly contribute a fix. However, tests are required and there seems to be no test infrastructure for UnitTestElement yet, which makes it difficult for me to submit a PR right away.
It seems to me the issue would be resolved by simply adding the line
dispatchMouseEvent(this.element, 'mouseover');
here: https://github.com/angular/components/blob/master/src/cdk/testing/testbed/unit-test-element.ts
Reproduction
Steps to reproduce:
Expected Behavior
A mouseover event is triggered when using the
hover()
method.Actual Behavior
No mouseover event is triggered when using the
hover()
method.Environment
The text was updated successfully, but these errors were encountered: