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

test(select): relax test for IE8 bug #8465

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/ng/directive/selectSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,34 +1006,34 @@ describe('select', function() {
scope.values = [{id: 10, name: 'A'}, {id: 20, name: 'B'}];
});
expect(element.val()).toEqual('?');
expect(element.find('option').eq(0).attr('selected')).toEqual('selected');
expect(element.find('option').attr('selected')).toEqual('selected');

scope.$apply(function() {
scope.selected = 10;
});
// Here the ? option should disappear and the first real option should have selected attribute
expect(element.val()).toEqual('0');
expect(element.find('option').eq(0).attr('selected')).toEqual('selected');
expect(element.find('option').attr('selected')).toEqual('selected');

// Here the selected value is changed but we don't change the selected attribute
scope.$apply(function() {
scope.selected = 20;
});
expect(element.val()).toEqual('1');
expect(element.find('option').eq(0).attr('selected')).toEqual('selected');
expect(element.find('option').attr('selected')).toEqual('selected');

scope.$apply(function() {
scope.values.push({id: 30, name: 'C'});
});
expect(element.val()).toEqual('1');
expect(element.find('option').eq(0).attr('selected')).toEqual('selected');
expect(element.find('option').attr('selected')).toEqual('selected');

// Here the ? option should reappear and have selected attribute
scope.$apply(function() {
scope.selected = undefined;
});
expect(element.val()).toEqual('?');
expect(element.find('option').eq(0).attr('selected')).toEqual('selected');
expect(element.find('option').attr('selected')).toEqual('selected');
});
});

Expand Down