From f6c67e28c94033edf6a16eb6508de54679cb49db Mon Sep 17 00:00:00 2001 From: Andres Ornelas Mesta Date: Mon, 24 May 2010 13:54:32 -0700 Subject: happy --- jsTestDriver-jquery.conf | 3 +++ jsTestDriver.conf | 4 +++- scenario/widgets-scenario2.js | 5 +++-- scenario/widgets.html | 1 - src/scenario/Runner.js | 44 ++++++++++++++++++++++++++++--------------- src/scenario/bootstrap.js | 6 ++++-- test/jquery_alias.js | 1 + test/jquery_remove.js | 1 + test/scenario/RunnerSpec.js | 34 ++++++++++++++++++++++++++++++--- 9 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 test/jquery_alias.js create mode 100644 test/jquery_remove.js diff --git a/jsTestDriver-jquery.conf b/jsTestDriver-jquery.conf index dde88e80..128fcb6c 100644 --- a/jsTestDriver-jquery.conf +++ b/jsTestDriver-jquery.conf @@ -4,6 +4,7 @@ load: - lib/jasmine/jasmine-0.10.3.js - lib/jasmine-jstd-adapter/JasmineAdapter.js - lib/jquery/jquery-1.4.2.js + - test/jquery_alias.js - src/Angular.js - src/*.js - src/scenario/*.js @@ -17,3 +18,5 @@ exclude: - src/angular.suffix - src/angular-bootstrap.js - src/AngularPublic.js + - test/jquery_remove.js + diff --git a/jsTestDriver.conf b/jsTestDriver.conf index 6f959b8f..4a702a3e 100644 --- a/jsTestDriver.conf +++ b/jsTestDriver.conf @@ -3,7 +3,8 @@ server: http://localhost:9876 load: - lib/jasmine/jasmine-0.10.3.js - lib/jasmine-jstd-adapter/JasmineAdapter.js -# - lib/jquery/jquery-1.4.2.js + - lib/jquery/jquery-1.4.2.js + - test/jquery_remove.js - src/Angular.js - src/*.js - src/scenario/*.js @@ -13,6 +14,7 @@ load: - test/*.js exclude: + - test/jquery_alias.js - src/angular.prefix - src/angular.suffix - src/angular-bootstrap.js diff --git a/scenario/widgets-scenario2.js b/scenario/widgets-scenario2.js index e24cabad..b966b270 100644 --- a/scenario/widgets-scenario2.js +++ b/scenario/widgets-scenario2.js @@ -4,7 +4,7 @@ browser = { var self = this; self.testFrame.load(function(){ self.testFrame.unbind(); - self.testDocument = self.testWindow.angular.element(self.testWindow.document); + self.testDocument = jQuery(self.testWindow.document); done(); }); if (this.testFrame.attr('src') == url) { @@ -23,6 +23,7 @@ function input(selector) { var input = this.testDocument.find('input[name=' + selector + ']'); input.val(value); input.trigger('change'); + this.testWindow.angular.element(input[0]).trigger('change'); done(); }); } @@ -49,6 +50,6 @@ describe('widgets', function(){ browser.navigateTo('widgets.html'); expect('{{text.basic}}').toEqual(''); input('text.basic').enter('John'); - expect('{{text.basic}}').toEqual('JohnXX'); + expect('{{text.basic}}').toEqual('John'); }); }); diff --git a/scenario/widgets.html b/scenario/widgets.html index 5c3afa21..4d0f30b0 100644 --- a/scenario/widgets.html +++ b/scenario/widgets.html @@ -2,7 +2,6 @@
- diff --git a/src/scenario/Runner.js b/src/scenario/Runner.js index 970d0c66..9e20d394 100644 --- a/src/scenario/Runner.js +++ b/src/scenario/Runner.js @@ -1,8 +1,9 @@ angular['scenario'] = (angular['scenario'] = {}); -angular.scenario.Runner = function(scope){ +angular.scenario.Runner = function(scope, jQuery){ var self = scope.$scenario = this; this.scope = scope; + this.jQuery = jQuery; var specs = this.specs = {}; var path = []; @@ -27,6 +28,7 @@ angular.scenario.Runner = function(scope){ angular.scenario.Runner.prototype = { run: function(body){ + var jQuery = this.jQuery; body.append( '