aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-06-22 14:30:56 -0700
committerIgor Minar2011-06-23 08:12:01 -0700
commit9ec45ad5c45791c81d4d1909ea1abceedc5ed3e9 (patch)
tree0e23535f4388c5bbdc5c183cbfe4e1e558fe4d38 /test/widgetsSpec.js
parent8e880fcb77bdcca2fd4a25f1333acc45dca75d8b (diff)
downloadangular.js-9ec45ad5c45791c81d4d1909ea1abceedc5ed3e9.tar.bz2
fix:ng:repeater - fix $position when collection size changes
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index d3b2ec5d..aadc1597 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -893,7 +893,11 @@ describe("widget", function(){
it('should expose iterator position as $position when iterating over arrays', function() {
var scope = compile('<ul><li ng:repeat="item in items" ' +
'ng:bind="item + \':\' + $position + \'|\'"></li></ul>');
- scope.items = ['misko', 'shyam', 'doug', 'frodo'];
+ scope.items = ['misko', 'shyam', 'doug'];
+ scope.$eval();
+ expect(element.text()).toEqual('misko:first|shyam:middle|doug:last|');
+
+ scope.items.push('frodo');
scope.$eval();
expect(element.text()).toEqual('misko:first|shyam:middle|doug:middle|frodo:last|');
});