I'd like to add some functionality to be able to navigate through the results with the arrow keys. I've got the functionality pretty much working, but I'm having some trouble writing a suitable test.
The problem is Pretender is returning a JavaScript array, but in my new code I want to use .any and .objectAt which are Ember Array methods. I can see you've partially solved the issue in dummy/app/routes/application.js where the results are wrapped in emberArray. However, the hyper-search component itself also makes a request (using the ajax method). This data is a plain JS array in tests, which is awkward.
Do you have any thoughts for a good solution to this?
Hi Lauren
Firstly, thanks for this addon - it's great!
I'd like to add some functionality to be able to navigate through the results with the arrow keys. I've got the functionality pretty much working, but I'm having some trouble writing a suitable test.
The problem is Pretender is returning a JavaScript array, but in my new code I want to use
.any
and.objectAt
which are Ember Array methods. I can see you've partially solved the issue in dummy/app/routes/application.js where the results are wrapped in emberArray. However, the hyper-search component itself also makes a request (using theajax
method). This data is a plain JS array in tests, which is awkward.Do you have any thoughts for a good solution to this?