Skip to content

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

Closed
@micgro42

Description

@micgro42

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions