iron-test-helpers
iron-test-helpers copied to clipboard
Expose click() in MockInteractions
How else are we supposed to test a click on a certain xy-location...
Hi, a click
event would need to generate also up and down event before getting fired. This is done by tap
- see implementation.
If you want to set a different xy
instead of the middle of the node, we could just handle a new property in the options
object passed to tap
, e.g.
MockInteractions.tap(node, {
xy: MockInteractions.topLeftOfNode(node)
});
const bounds = node.getBoundingClientRect();
MockInteractions.tap(node, {
xy: { x: bounds.left + 5, y: bounds.top + 10 }
});
Mind opening an issue for this?