diff options
| author | Misko Hevery | 2011-11-15 11:19:37 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2011-11-15 11:47:23 -0800 | 
| commit | aba9bb2a241f832d1b09d75e05973a985b817cc1 (patch) | |
| tree | 6ddb913280963ce1737d8811d786f82083436344 /test/widget/inputSpec.js | |
| parent | 5857c44e0cc52309251c932f9c530958dfdb616c (diff) | |
| download | angular.js-aba9bb2a241f832d1b09d75e05973a985b817cc1.tar.bz2 | |
fix(input): treat all not number model as blank
Diffstat (limited to 'test/widget/inputSpec.js')
| -rw-r--r-- | test/widget/inputSpec.js | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index 085cb2ea..dfbc506a 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -449,6 +449,18 @@ describe('widget: input', function() {        });      }); +    describe('number', function(){ +      it('should clear number on non-number', inject(function($compile, $rootScope){ +        $rootScope.value = 123; +        var element = $compile('<input type="number" ng:model="value" >')($rootScope); +        $rootScope.$digest(); +        expect(element.val()).toEqual('123'); +        $rootScope.value = undefined; +        $rootScope.$digest(); +        expect(element.val()).toEqual(''); +      })); +    }); +      it('should ignore text widget which have no name', function() {        compile('<input type="text"/>'); | 
