201-created / ember-cli-acceptance-test-helpers

A set of useful test helpers for ember acceptance tests.
https://www.npmjs.com/package/ember-cli-acceptance-test-helpers
MIT License
47 stars 17 forks source link

expectElement greater than a certain count? #11

Open jme783 opened 9 years ago

jme783 commented 9 years ago

Maybe I'm missing something, but is it possible to use the expectElement method to test if there is at least a certain number of elements, instead of exactly the number of elements defined in count? I want to test that a list of models are returned, but I'm not sure how many will be there.

Thanks!

bantic commented 9 years ago

@jme783 There isn't, but I'll mark this as a feature request, as I think that's a good idea.

jme783 commented 9 years ago

@bantic Sounds good, for the time being I created a single wrapper around my list of objects that only would be present if there were items returned.

BryanCrotaz commented 9 years ago

I've done this for "at least 1" for expectComponent in commit bb3b2449c39f1fe3019c9ab5b5b0d8eb46311987

I'd suggest you create a PR mirroring my fixes and new tests for expectElement, and add an options object with { comparison: "equals" | "atLeast" | "atMost" } where default is equals