From 1087270c95f6bbafd3715c9a5eecdafac79c9daa Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 18 Aug 2010 16:04:40 -0700 Subject: added better handling of ng:format=number --- test/widgetsSpec.js | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'test/widgetsSpec.js') diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index ad98e482..9134500a 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -338,17 +338,35 @@ describe("widget", function(){ }); - it('should support type="select-one"', function(){ - compile( - '' + + '' + + '' + ''); - expect(scope.selection).toEqual('B'); - scope.selection = 'A'; - scope.$eval(); - expect(scope.selection).toEqual('A'); - expect(element[0].childNodes[0].selected).toEqual(true); + expect(scope.selection).toEqual('B'); + scope.selection = 'A'; + scope.$eval(); + expect(scope.selection).toEqual('A'); + expect(element[0].childNodes[0].selected).toEqual(true); + }); + + it('should honor the value field in option', function(){ + compile( + ''); + // childNodes[0] is repeater + expect(scope.selection).toEqual(undefined); + + click(element[0].childNodes[1]); + expect(scope.selection).toEqual(0); + + scope.selection = 1; + scope.$eval(); + expect(element[0].childNodes[2].selected).toEqual(true); + }); }); it('should support type="select-multiple"', function(){ -- cgit v1.2.3