From 26adeb119bc4fafa6286de484626b8de4170abc9 Mon Sep 17 00:00:00 2001 From: _pants Date: Thu, 29 Nov 2012 11:46:51 -0500 Subject: fix(select): support optgroup + select[multiple] combo Closes #1553 --- test/ng/directive/selectSpec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/ng/directive') diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js index 7d17a185..2b56228d 100644 --- a/test/ng/directive/selectSpec.js +++ b/test/ng/directive/selectSpec.js @@ -405,6 +405,27 @@ describe('select', function() { expect(element).toEqualSelect(['A'], ['B']); }); + it('should work with optgroups', function() { + compile(''); + + expect(element).toEqualSelect('A', 'B'); + expect(scope.selection).toBeUndefined(); + + scope.$apply(function() { + scope.selection = ['A']; + }); + expect(element).toEqualSelect(['A'], 'B'); + + scope.$apply(function() { + scope.selection.push('B'); + }); + expect(element).toEqualSelect(['A'], ['B']); + }); it('should require', function() { compile( -- cgit v1.2.3