From 6ecac8e71a84792a434d21db2c245b3648c55f18 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 15 Mar 2012 14:19:20 -0700 Subject: fix(select): multiselect failes to update view on selection insert In multiselect when the underlying selection array push/pops an element the view did not re-render since the array reference stayed the same. --- test/directive/selectSpec.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/directive/selectSpec.js b/test/directive/selectSpec.js index e374fbe1..3f8fb56e 100644 --- a/test/directive/selectSpec.js +++ b/test/directive/selectSpec.js @@ -102,7 +102,15 @@ describe('select', function() { scope.selection = ['A']; }); - expect(element[0].childNodes[0].selected).toEqual(true); + expect(element.find('option')[0].selected).toEqual(true); + expect(element.find('option')[1].selected).toEqual(false); + + scope.$apply(function() { + scope.selection.push('B'); + }); + + expect(element.find('option')[0].selected).toEqual(true); + expect(element.find('option')[1].selected).toEqual(true); }); -- cgit v1.2.3