selecto icon indicating copy to clipboard operation
selecto copied to clipboard

Acceptance testing strategies?

Open bagby opened this issue 3 years ago • 1 comments

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.

output

bagby avatar Jun 09 '21 15:06 bagby

@bagby

Selecto uses mousedown, mousemove, and mouseup events.

daybrush avatar Jun 16 '21 16:06 daybrush