From 006fd2ca252400e87a419b929e00ea0277ff86ad Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 21 Sep 2010 19:20:34 +0200 Subject: HEAD is now at 10c0151 Fixes on issue when a SELECT has OPTION which are data bound (ie OPTION has repeater or OPTION.value is bound), then SELECT does not update to match the correct OPTION after the change in model (ie after the OPTION repeater unrolls or OPTION.value is changed.) --- test/ScopeSpec.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/ScopeSpec.js') diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js index ea63fea4..66e9d489 100644 --- a/test/ScopeSpec.js +++ b/test/ScopeSpec.js @@ -192,4 +192,27 @@ describe('scope/model', function(){ }); }); + + describe('$postEval', function(){ + it('should eval function once and last', function(){ + var log = ''; + var scope = createScope(); + function onceOnly(){log+= '@';} + scope.$onEval(function(){log+= '.';}); + scope.$postEval(function(){log+= '!';}); + scope.$postEval(onceOnly); + scope.$postEval(onceOnly); + scope.$postEval(); // ignore + scope.$eval(); + expect(log).toEqual('.!@'); + scope.$eval(); + expect(log).toEqual('.!@.'); + + scope.$postEval(onceOnly); + scope.$postEval(onceOnly); + scope.$eval(); + expect(log).toEqual('.!@..@'); + }); + }); + }); -- cgit v1.2.3