blob: 2b14bb3338601bc6037994f8e9530f5712cb1f26 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 | 'use strict';
describe('event directives', function() {
  var element;
  afterEach(function() {
    dealoc(element);
  });
  describe('ng:submit', function() {
    it('should get called on form submit', inject(function($rootScope, $compile) {
      element = $compile('<form action="" ng:submit="submitted = true">' +
        '<input type="submit"/>' +
        '</form>')($rootScope);
      $rootScope.$digest();
      expect($rootScope.submitted).not.toBeDefined();
      browserTrigger(element.children()[0]);
      expect($rootScope.submitted).toEqual(true);
    }));
  });
});
 |