Open steventill opened 8 years ago
fireevent does not properly pass the details to the event handler
the receiving event handler has detail set to what props are
all of the props are props on the event and detail is undefined
TestHelper.fireevent( 'item-removed', { id: '123' } );
all
global.fireEvent = function(type, props, node) { // detail is a readonly event on custom event if it is not set when you create it var event = new CustomEvent(type, { bubbles: true, cancelable: true, detail: props });
node.dispatchEvent(event);
};
I'm requesting this too. I'm not allowed to use this function and set detail object which is read only after the CustomEvent is created.
detail
CustomEvent
Description
fireevent does not properly pass the details to the event handler
Expected outcome
the receiving event handler has detail set to what props are
Actual outcome
all of the props are props on the event and detail is undefined
Steps to reproduce
TestHelper.fireevent( 'item-removed', { id: '123' } );
Browsers Affected
all
Possible fix
global.fireEvent = function(type, props, node) { // detail is a readonly event on custom event if it is not set when you create it var event = new CustomEvent(type, { bubbles: true, cancelable: true, detail: props });
};