mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-08 09:07:46 +08:00
test(ngOptions): ensure that one-time bindings works in ngOptions
Related #7700 Closes #8029
This commit is contained in:
@@ -987,6 +987,20 @@ describe('select', function() {
|
||||
expect(element.find('option').eq(0).prop('selected')).toBeTruthy();
|
||||
expect(element.find('option').length).toEqual(2);
|
||||
});
|
||||
|
||||
|
||||
it('should use exact same values as values in scope with one-time bindings', function() {
|
||||
scope.values = [{name: 'A'}, {name: 'B'}];
|
||||
scope.selected = scope.values[0];
|
||||
createSelect({
|
||||
'ng-model': 'selected',
|
||||
'ng-options': 'value.name for value in ::values'
|
||||
});
|
||||
|
||||
browserTrigger(element.find('option').eq(1));
|
||||
|
||||
expect(scope.selected).toBe(scope.values[1]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user