Skip to content

Commit bbd87c9

Browse files
IgorMinarmhevery
authored andcommitted
simplifying ng:click spec
1 parent 64063b5 commit bbd87c9

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/directives.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ angularWidget("@ng:repeat", function(expression, element){
205205
*
206206
* Events that are handled via these handler are always configured not to propagate further.
207207
*
208-
* TODO: maybe we should consider allowing users to control even propagation in the future.
208+
* TODO: maybe we should consider allowing users to control event propagation in the future.
209209
*/
210210
angularDirective("ng:click", function(expression, element){
211211
return function(element){

test/directivesSpec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe("directives", function(){
172172
});
173173

174174
describe('ng:click', function(){
175-
it('should fire event', function(){
175+
it('should get called on a click', function(){
176176
var scope = compile('<div ng:click="clicked = true"></div>');
177177
scope.$eval();
178178
expect(scope.$get('clicked')).toBeFalsy();
@@ -184,14 +184,14 @@ describe("directives", function(){
184184
it('should stop event propagation', function() {
185185
var scope = compile('<div ng:click="outer = true"><div ng:click="inner = true"></div></div>');
186186
scope.$eval();
187-
expect(scope.$get('outer')).not.toBeDefined();
188-
expect(scope.$get('inner')).not.toBeDefined();
187+
expect(scope.outer).not.toBeDefined();
188+
expect(scope.inner).not.toBeDefined();
189189

190-
var innerDiv = jqLite(element.children()[0]);
190+
var innerDiv = element.children()[0];
191191

192192
browserTrigger(innerDiv, 'click');
193-
expect(scope.$get('outer')).not.toBeDefined();
194-
expect(scope.$get('inner')).toEqual(true);
193+
expect(scope.outer).not.toBeDefined();
194+
expect(scope.inner).toEqual(true);
195195
});
196196
});
197197

0 commit comments

Comments
 (0)