diff options
Diffstat (limited to 'test/directive/inputSpec.js')
| -rw-r--r-- | test/directive/inputSpec.js | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js index e7c40b0a..6298fc64 100644 --- a/test/directive/inputSpec.js +++ b/test/directive/inputSpec.js @@ -34,25 +34,6 @@ describe('NgModelController', function() { }); - describe('touch', function() { - it('should only fire $viewTouch when pristine', function() { - var spy = jasmine.createSpy('$viewTouch'); - scope.$on('$viewTouch', spy); - - ctrl.touch(); - expect(ctrl.pristine).toBe(false); - expect(ctrl.dirty).toBe(true); - expect(spy).toHaveBeenCalledOnce(); - - spy.reset(); - ctrl.touch(); - expect(ctrl.pristine).toBe(false); - expect(ctrl.dirty).toBe(true); - expect(spy).not.toHaveBeenCalled(); - }); - }); - - describe('setValidity', function() { it('should emit $invalid only when $valid', function() { @@ -150,6 +131,23 @@ describe('NgModelController', function() { ctrl.setViewValue('val'); expect(spy).not.toHaveBeenCalled(); }); + + + it('should only fire $viewTouch when pristine', function() { + var spy = jasmine.createSpy('$viewTouch'); + scope.$on('$viewTouch', spy); + + ctrl.setViewValue(''); + expect(ctrl.pristine).toBe(false); + expect(ctrl.dirty).toBe(true); + expect(spy).toHaveBeenCalledOnce(); + + spy.reset(); + ctrl.setViewValue(''); + expect(ctrl.pristine).toBe(false); + expect(ctrl.dirty).toBe(true); + expect(spy).not.toHaveBeenCalled(); + }); }); |
