I have an array of strings, which I need to allow for duplicates.
vm.list = ["item","item","item","item","item"]
this is handled in the html with
<ul class="listItems>
<li ng-repeat="item in ctrl.list track by $index"></li>
</ul>
This displays fine in the DOM, no issues, but I run into problems when I try to protractor test the ng-repeat, since I can't unit test it.
So my test is something like.
Then("List items should contain {int} items.", function(listLength){
return element(by.css(".listItems").all(by.repeater('item in ctrl.list track by $index')).then(function(list){
return expect(list.length).equal(listLength);
});
});
I run my tests and it fails with Expect 0 to be 5 But if I make them all unique it works fine, how can I fix this?