Skip to content

Creating dom event with readonly props doesn't work on inherited events #1762

Open
@599316527

Description

@599316527

Subject of the issue

Fail to trigger dragstart event on wrapper with clientX/Y props

Steps to reproduce

wrapper.trigger('dragstart', {clientX: 999})

Expected behaviour

Events are triggered.

Actual behaviour

Got error:

TypeError: Cannot set property clientX of #<MouseEvent> which has only a getter
	    at eval (webpack-internal:///./node_modules/@vue/test-utils/dist/vue-test-utils.js:3141:18)

Possible Solution

Screen Shot 2021-01-07 at 12 24 23

Since DragEvent inherits properties from MouseEvent, we shall get prototype recursively until find the field.

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions