I want to test that my ng-repeat
generates more than 1 element.
<div ng-repeat="topic in topics">
<div class="topic-name">{{topic.name}}</div>
</div>
How can I do it? I can't find in the docs...
Is there something like this?
expect(element.all(by.repeater('topic in topics')).count()).toBeMoreThan(1);
It is located in the Jasmine 2.0 docs, here. Try the following code:
var count = element.all(by.repeater('topic in topics'));
count.then(function(result){
expect(result.length).toBeGreaterThan(1);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With