ember-basic-dropdown icon indicating copy to clipboard operation
ember-basic-dropdown copied to clipboard

open dropdown with pending request

Open vincentcapicotto opened this issue 7 years ago • 1 comments

Hi,

I have difficulties for using the dropdown in acceptance tests with mirage server and timing response. When I try to test the behavior:

  • set a mirage request with a timing response
  • trigger an action which send the request to the server
  • click on dropdown and click on an entry of the dropdown before the respond At this last step, the dropdown is deployed but it's waiting the response before click on the entry, and that is my problem, I want click before the respond. Any ideas ? Thanks

Note: we are using ember 2.12

vincentcapicotto avatar Aug 26 '18 10:08 vincentcapicotto

I feel that this is more a testing question than one about EPS.

Still, if you are using the new testing API (that uses asyc/await) it's relatively simple to decide when you want to wait for an async operation to finish and when you don't.

let requestPromise = click('.button-that-triggers-request');
await click('.dropdown-trigger');
await click('.some-entry')
await requestPromise();

Maybe something like that can work.

cibernox avatar Aug 27 '18 12:08 cibernox