Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7e6e0d6

Browse files
committedJul 15, 2014
test(ngOptions): ensure that one-time bindings works in ngOptions
Related #7700 Closes #8029
1 parent 86d55c1 commit 7e6e0d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎test/ng/directive/selectSpec.js

+14
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,20 @@ describe('select', function() {
987987
expect(element.find('option').eq(0).prop('selected')).toBeTruthy();
988988
expect(element.find('option').length).toEqual(2);
989989
});
990+
991+
992+
it('should use exact same values as values in scope with one-time bindings', function() {
993+
scope.values = [{name: 'A'}, {name: 'B'}];
994+
scope.selected = scope.values[0];
995+
createSelect({
996+
'ng-model': 'selected',
997+
'ng-options': 'value.name for value in ::values'
998+
});
999+
1000+
browserTrigger(element.find('option').eq(1));
1001+
1002+
expect(scope.selected).toBe(scope.values[1]);
1003+
});
9901004
});
9911005

9921006

0 commit comments

Comments
 (0)