selecto
selecto copied to clipboard
Acceptance testing strategies?
Environments
- Framework name: Ember.js
- Framework version: 3.22
- Component name: Selecto
- Component version: 1.10.2
- Testable Address(optional):
Description
I am trying to write some acceptance tests around Selecto, and I was wondering if anyone has any good testing strategies. Basically, I want to test that when I select a region, a modal appears with the appropriate data (see screencap below). Ember has pretty good test helpers to allow triggering events, for example you could write a helper for drag and drop:
export async function dragAndDrop(fieldSelector, dropZoneSelector, options) {
await triggerEvent(fieldSelector, 'mousedown');
await triggerEvent(fieldSelector, 'dragstart', options);
await triggerEvent(dropZoneSelector, 'dragenter', options);
await triggerEvent(dropZoneSelector, 'drop', options);
}
I've tried something similar to simulate selecting a region, but haven't found what events I need to trigger to do that. OR if anyone has suggestions on how to hook into Selecto's event directly, that would be appreciated.
@bagby
Selecto uses mousedown, mousemove, and mouseup events.