Skip to content

'disabled' attribute prevents triggering events on all HTML tags #1321

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

Closed
micgro42 opened this issue Oct 15, 2019 · 1 comment · Fixed by #1362
Closed

'disabled' attribute prevents triggering events on all HTML tags #1321

micgro42 opened this issue Oct 15, 2019 · 1 comment · Fixed by #1362

Comments

@micgro42
Copy link

Version

1.0.0-beta.29

Reproduction link

https://github.com/micgro42/vue-test-utils-disabled-bug

Steps to reproduce

  1. check out minimal reproduction repository
  2. run npm install
  3. run npm run test:unit

What is expected?

Test should pass, because the disabled attribute on a link (HTML <a> tag) is ignored by browsers and thus the component should handle the event (in this case: emit it to the parent component/wrapper)

What is actually happening?

Test fails, because wrapper.trigger() does nothing 😭.


This was caused by #424 in order to fix #395.
Unfortunately, this solution is too far-reaching. This also disables events, for example, on links with the disabled attribute.
While that might be the desired final state, it is not something that is provided by the browser and thus needs to be programmed and asserted by tests. Just plainly disabling the wrapper.trigger method in that case prevents me from testing this.

@hiendv
Copy link
Contributor

hiendv commented Dec 3, 2019

I'm sharing the same problem with you.
@eddyerburgh We should respect the disabled attribute only for supported elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants