From 1752c8c44a7058e974ef208e583683eac8817789 Mon Sep 17 00:00:00 2001
From: Misko Hevery
Date: Mon, 6 Feb 2012 21:56:35 -0800
Subject: feat(directive): event now accessible as $event
Closes 259
---
test/BinderSpec.js | 24 ------------------------
test/directivesSpec.js | 11 ++++-------
2 files changed, 4 insertions(+), 31 deletions(-)
(limited to 'test')
diff --git a/test/BinderSpec.js b/test/BinderSpec.js
index b869c616..f7a1c1b3 100644
--- a/test/BinderSpec.js
+++ b/test/BinderSpec.js
@@ -438,30 +438,6 @@ describe('Binder', function() {
assertChild(5, false);
}));
- it('ItShouldDisplayErrorWhenActionIsSyntacticlyIncorrect', function() {
- module(function($exceptionHandlerProvider){
- $exceptionHandlerProvider.mode('log');
- });
- inject(function($rootScope, $exceptionHandler, $log, $compile) {
- element = $compile(
- '
' +
- '' +
- '' +
- '
')($rootScope);
- var first = jqLite(element.find('input')[0]);
- var second = jqLite(element.find('input')[1]);
- var errorLogs = $log.error.logs;
-
- browserTrigger(first, 'click');
- expect($rootScope.greeting).toBe('ABC');
- expect(errorLogs).toEqual([]);
-
- browserTrigger(second, 'click');
- expect($exceptionHandler.errors[0]).
- toMatchError(/Syntax Error: Token ':' not a primary expression/);
- });
- });
-
it('ItShouldSelectTheCorrectRadioBox', inject(function($rootScope, $compile) {
element = $compile(
'' +
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 9dee4860..45f1cffc 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -137,15 +137,12 @@ describe("directive", function() {
expect($rootScope.clicked).toEqual(true);
}));
- it('should stop event propagation', inject(function($rootScope, $compile) {
- element = $compile('
')($rootScope);
+ it('should pass event object', inject(function($rootScope, $compile) {
+ element = $compile('
')($rootScope);
$rootScope.$digest();
- expect($rootScope.outer).not.toBeDefined();
- expect($rootScope.inner).not.toBeDefined();
- browserTrigger(element.find('div'), 'click');
- expect($rootScope.outer).not.toBeDefined();
- expect($rootScope.inner).toEqual(true);
+ browserTrigger(element, 'click');
+ expect($rootScope.event).toBeDefined();
}));
});
--
cgit v1.2.3