diff options
| author | Mikk Kirstein | 2013-05-14 20:14:06 +0300 |
|---|---|---|
| committer | Igor Minar | 2013-07-11 14:58:35 -0700 |
| commit | 09a1e7af129880cab89a2f709f22a7286f52371e (patch) | |
| tree | e1abe6086fb1c31b1dbfc448ae5ec035cc0ff0a8 /test/ng/directive/inputSpec.js | |
| parent | 52d6a5990225439ac9141398d83e0d4e6134b576 (diff) | |
| download | angular.js-09a1e7af129880cab89a2f709f22a7286f52371e.tar.bz2 | |
fix(ngValue): made ngValue to write value attribute to element
Diffstat (limited to 'test/ng/directive/inputSpec.js')
| -rw-r--r-- | test/ng/directive/inputSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 86fad41a..36fb754d 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -1136,6 +1136,18 @@ describe('input', function() { describe('ngValue', function() { + it('should update the dom "value" property and attribute', function() { + compileInput('<input type="submit" ng-value="value">'); + + scope.$apply(function() { + scope.value = 'something'; + }); + + expect(inputElm[0].value).toBe('something'); + expect(inputElm[0].getAttribute('value')).toBe('something'); + }); + + it('should evaluate and set constant expressions', function() { compileInput('<input type="radio" ng-model="selected" ng-value="true">' + '<input type="radio" ng-model="selected" ng-value="false">' + |
