mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-07 08:57:54 +08:00
test(select): add extra expectations and comments for clarity
This commit is contained in:
@@ -735,6 +735,8 @@ describe('select', function() {
|
||||
|
||||
it('should not update selected property of an option element on digest with no change event',
|
||||
function() {
|
||||
// ng-options="value.name for value in values"
|
||||
// ng-model="selected"
|
||||
createSingleSelect();
|
||||
|
||||
scope.$apply(function() {
|
||||
@@ -743,6 +745,11 @@ describe('select', function() {
|
||||
});
|
||||
|
||||
var options = element.find('option');
|
||||
|
||||
expect(scope.selected).toEqual({ name: 'A' });
|
||||
expect(options.eq(0).prop('selected')).toBe(true);
|
||||
expect(options.eq(1).prop('selected')).toBe(false);
|
||||
|
||||
var optionToSelect = options.eq(1);
|
||||
|
||||
expect(optionToSelect.text()).toBe('B');
|
||||
|
||||
Reference in New Issue
Block a user