mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-20 23:00:59 +00:00
26 lines
588 B
JavaScript
26 lines
588 B
JavaScript
|
|
'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);
|
||
|
|
}));
|
||
|
|
});
|
||
|
|
});
|