I'm trying to write a test where I check the ammount of items in a ng-repeat. After that I add 1 item to that ng-repeat and I want to see if the old value+1 is equal to the new value.
This is my html:
<tr ng-repeat="list in listData.myLists">...</tr>
And my test
describe("list test", function(){
it('Description of the test', function(){
browser.get('app/#/list');
var list = element.all(by.repeater('list in listData.myLists'));
var ammount;
list.count().then(function(c) {
ammount = c;
});
... Here I add an item
var secondAmmount = element.all(by.repeater('list in listData.myLists')).count();
expect(secondAmmount).toEqual(ammount + 1);
});
});
But I'm getting 7 is not equal to NaN.
I have also tried just adding the list.count() + 1 directly into the toEquals method but then I get an object instead of a number.
Is there something I'm doing wrong here? Thanks for any help in advance