diff options
| author | Misko Hevery | 2012-01-06 18:10:47 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2012-01-10 22:27:00 -0800 | 
| commit | 5143e7bf065a3cbdf8400cf095b653d51bc83b8f (patch) | |
| tree | 980149c365d4cb5586d27975d26366a25ff7be6a /test | |
| parent | afd25446d23f24872eb20ac79c8fbd2cff203ef0 (diff) | |
| download | angular.js-5143e7bf065a3cbdf8400cf095b653d51bc83b8f.tar.bz2 | |
feat(module): new module loader
Diffstat (limited to 'test')
| -rw-r--r-- | test/AngularSpec.js | 163 | ||||
| -rw-r--r-- | test/InjectorSpec.js | 41 | ||||
| -rw-r--r-- | test/angular-mocksSpec.js | 54 | ||||
| -rw-r--r-- | test/loaderSpec.js | 63 | ||||
| -rw-r--r-- | test/scenario/ApplicationSpec.js | 4 | ||||
| -rw-r--r-- | test/scenario/RunnerSpec.js | 4 | ||||
| -rw-r--r-- | test/scenario/dslSpec.js | 36 | ||||
| -rw-r--r-- | test/scenario/e2e/widgets.html | 4 | ||||
| -rw-r--r-- | test/service/cookiesSpec.js | 2 | ||||
| -rw-r--r-- | test/service/filter/filtersSpec.js | 8 | ||||
| -rw-r--r-- | test/service/logSpec.js | 2 | ||||
| -rw-r--r-- | test/widgetsSpec.js | 8 | 
12 files changed, 195 insertions, 194 deletions
| diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 70997240..55842acd 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -264,148 +264,83 @@ describe('angular', function() {    }); -  describe('angularJsConfig', function() { -    it('should always consider angular.js script tag to be the last script tag', function() { -      var doc = { -        getElementsByTagName: function(tagName) { -          expect(tagName).toEqual('script'); -          return [{nodeName: 'SCRIPT', src: 'random.js', -                    attributes: [{name: 'ng:autobind', value: 'wrong'}]}, -                  {nodeName: 'SCRIPT', src: 'angular.js', -                    attributes: [{name: 'ng:autobind', value: 'correct'}]}]; -        } -      }; +  describe('angularInit', function() { +    var bootstrap; +    var element; -      expect(angularJsConfig(doc)).toEqual({autobind: 'correct'}); +    beforeEach(function() { +      element = { +        getElementById: function (id) { +          return element.getElementById[id] || []; +        }, -      doc = { -        getElementsByTagName: function(tagName) { -          expect(tagName).toEqual('script'); -          return [{nodeName: 'SCRIPT', src: 'angular.js', -                    attributes: [{name: 'ng:autobind', value: 'wrong'}]}, -                  {nodeName: 'SCRIPT', src: 'concatinatedAndObfuscadedScriptWithOurScript.js', -                    attributes: [{name: 'ng:autobind', value: 'correct'}]}]; +        getAttribute: function(name) { +          return element[name];          }        }; - -      expect(angularJsConfig(doc)).toEqual({autobind: 'correct'}); +      bootstrap = jasmine.createSpy('bootstrap');      }); -    it('should extract angular config from the ng: attributes', function() { -      var doc = { getElementsByTagName: function(tagName) { -        expect(lowercase(tagName)).toEqual('script'); -        return [{ -          nodeName: 'SCRIPT', -          src: 'angularjs/angular.js', -          attributes: [{name: 'ng:autobind', value:'elementIdToCompile'}, -                       {name: 'ng:css', value: 'css/my_custom_angular.css'}] }]; -      }}; - -      expect(angularJsConfig(doc)).toEqual({ -        autobind: 'elementIdToCompile', -        css: 'css/my_custom_angular.css' -      }); +    it('should do nothing when not found', function() { +      angularInit(element, bootstrap); +      expect(bootstrap).not.toHaveBeenCalled();      }); -    it('should extract angular config and default autobind value to true if present', function() { -      var doc = { getElementsByTagName: function(tagName) { -        expect(lowercase(tagName)).toEqual('script'); -        return [{ -          nodeName: 'SCRIPT', -          src: 'angularjs/angular.js', -          attributes: [{name: 'ng:autobind', value:undefined}]}]; -      }}; - -      expect(angularJsConfig(doc)).toEqual({autobind: true}); +    it('should look for ng:app directive in id', function() { +      var appElement = jqLite('<div id="ng:app" data-ng-app="ABC"></div>')[0]; +      jqLite(document.body).append(appElement); +      angularInit(element, bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, ['ABC']);      }); -    it('should extract angular autobind config from the script hashpath attributes', function() { -      var doc = { getElementsByTagName: function(tagName) { -        expect(lowercase(tagName)).toEqual('script'); -        return [{ -          nodeName: 'SCRIPT', -          src: 'angularjs/angular.js#autobind'}]; -      }}; - -      expect(angularJsConfig(doc)).toEqual({autobind: true}); +    it('should look for ng:app directive in className', function() { +      var appElement = jqLite('<div data-ng-app="ABC"></div>')[0]; +      element.querySelectorAll = function(arg) { return element.querySelectorAll[arg] || []; } +      element.querySelectorAll['.ng\\:app'] = [appElement]; +      angularInit(element, bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, ['ABC']);      }); -    it('should extract autobind config with element id from the script hashpath', function() { -      var doc = { getElementsByTagName: function(tagName) { -        expect(lowercase(tagName)).toEqual('script'); -        return [{ -          nodeName: 'SCRIPT', -          src: 'angularjs/angular.js#autobind=foo'}]; -      }}; - -      expect(angularJsConfig(doc)).toEqual({autobind: 'foo'}); +    it('should look for ng:app directive using querySelectorAll', function() { +      var appElement = jqLite('<div x-ng-app="ABC"></div>')[0]; +      element.querySelectorAll = function(arg) { return element.querySelectorAll[arg] || []; } +      element.querySelectorAll['[ng\\:app]'] = [ appElement ]; +      angularInit(element, bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, ['ABC']);      }); -    it('should default to versioned ie-compat file if angular file is versioned', function() { -      var doc = { getElementsByTagName: function(tagName) { -        expect(lowercase(tagName)).toEqual('script'); -        return [{ -          nodeName: 'SCRIPT', -          src: 'js/angular-0.9.0.js'}]; -      }}; - -      expect(angularJsConfig(doc)).toEqual({}); +    it('should bootstrap using class name', function() { +      var appElement = jqLite('<div class="ng-app: ABC;"></div>')[0]; +      angularInit(jqLite('<div></div>').append(appElement)[0], bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, ['ABC']);      }); -  }); -  describe('angularInit', function() { -    var dom; - -    beforeEach(function() { -      dom = jqLite('<div foo="{{1+2}}">{{2+3}}' + -                     '<div id="child" bar="{{3+4}}">{{4+5}}</div>' + -                   '</div>')[0]; -    }); - - -    afterEach(function() { -      dealoc(dom); -    }); - - -    it('should not compile anything if autobind is missing or false', function() { -      angularInit({}, dom); -      expect(sortedHtml(dom)).toEqual('<div foo="{{1+2}}">{{2+3}}' + -                                        '<div bar="{{3+4}}" id="child">{{4+5}}</div>' + -                                      '</div>'); +    it('should bootstrap anonymously', function() { +      var appElement = jqLite('<div x-ng-app></div>')[0]; +      element.querySelectorAll = function(arg) { return element.querySelectorAll[arg] || []; } +      element.querySelectorAll['[x-ng-app]'] = [ appElement ]; +      angularInit(element, bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, []);      }); -    it('should compile the document if autobind is true', function() { -      angularInit({autobind: true}, dom); -      expect(sortedHtml(dom)).toEqual('<div foo="3" ng:bind-attr="{"foo":"{{1+2}}"}">' + -                                        '<span ng:bind="2+3">5</span>' + -                                        '<div bar="7" id="child" ng:bind-attr="{"bar":"{{3+4}}"}">'+ -                                          '<span ng:bind="4+5">9</span>' + -                                        '</div>' + -                                      '</div>'); +    it('should bootstrap anonymously using class only', function() { +      var appElement = jqLite('<div class="ng-app"></div>')[0]; +      angularInit(jqLite('<div></div>').append(appElement)[0], bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, []);      }); -    it('should compile only the element specified via autobind', function() { -      dom.getElementById = function() { -        return this.childNodes[1]; -      }; - - -      angularInit({autobind: 'child'}, dom); - -      expect(sortedHtml(dom)).toEqual('<div foo="{{1+2}}">{{2+3}}' + -                                        '<div bar="7" id="child" ng:bind-attr="{"bar":"{{3+4}}"}">'+ -                                          '<span ng:bind="4+5">9</span>' + -                                        '</div>' + -                                      '</div>'); +    it('should bootstrap if the annotation is on the root element', function() { +      var appElement = jqLite('<div class="ng-app"></div>')[0]; +      angularInit(appElement, bootstrap); +      expect(bootstrap).toHaveBeenCalledOnceWith(appElement, []);      });    }); diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js index 0bce5ffd..3eec169a 100644 --- a/test/InjectorSpec.js +++ b/test/InjectorSpec.js @@ -224,22 +224,28 @@ describe('injector', function() {      it('should run symbolic modules', function() { -      var $injector = createInjector(['myModule'], { -        myModule: ['$provide', function(provide) { -          provide.value('a', 'abc'); -        }] -      }); +      angularModule('myModule', []).value('a', 'abc'); +      var $injector = createInjector(['myModule']);        expect($injector.get('a')).toEqual('abc');      }); -    it('should error on invalid madule name', function() { +    it('should error on invalid module name', function() {        expect(function() {          createInjector(['IDontExist'], {}); -      }).toThrow("Module 'IDontExist' is not defined!"); +      }).toThrow("No module: IDontExist");      }); +    it('should load dependant modules only once', function() { +      var log = ''; +      angular.module('a', [], function(){ log += 'a'; }); +      angular.module('b', ['a'], function(){ log += 'b'; }); +      angular.module('c', ['a', 'b'], function(){ log += 'c'; }); +      createInjector(['c', 'c']); +      expect(log).toEqual('abc'); +    }); +      describe('$provide', function() {        describe('value', function() {          it('should configure $provide values', function() { @@ -247,6 +253,13 @@ describe('injector', function() {              $provide.value('value', 'abc');            }]).get('value')).toEqual('abc');          }); + + +        it('should configure a set of values', function() { +          expect(createInjector([function($provide) { +            $provide.value({value: Array}); +          }]).get('value')).toEqual(Array); +        });        }); @@ -256,6 +269,13 @@ describe('injector', function() {              $provide.factory('value', valueFn('abc'));            }]).get('value')).toEqual('abc');          }); + + +        it('should configure a set of factories', function() { +          expect(createInjector([function($provide) { +            $provide.factory({value: Array}); +          }]).get('value')).toEqual([]); +        });        }); @@ -279,6 +299,13 @@ describe('injector', function() {              $provide.service('value', Type);            }]).get('value')).toEqual('abc');          }); + + +        it('should configure a set of services', function() { +          expect(createInjector([function($provide) { +            $provide.service({value: valueFn({$get:Array})}); +          }]).get('value')).toEqual([]); +        });        }); diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js index 054cabae..d7f40bb2 100644 --- a/test/angular-mocksSpec.js +++ b/test/angular-mocksSpec.js @@ -32,95 +32,95 @@ describe('mocks', function() {      }      it('should look like a Date', function() { -      var date = new angular.module.ngMock.TzDate(0,0); +      var date = new angular.mock.TzDate(0,0);        expect(angular.isDate(date)).toBe(true);      });      it('should take millis as constructor argument', function() { -      expect(new angular.module.ngMock.TzDate(0, 0).getTime()).toBe(0); -      expect(new angular.module.ngMock.TzDate(0, 1283555108000).getTime()).toBe(1283555108000); +      expect(new angular.mock.TzDate(0, 0).getTime()).toBe(0); +      expect(new angular.mock.TzDate(0, 1283555108000).getTime()).toBe(1283555108000);      });      it('should take dateString as constructor argument', function() { -      expect(new angular.module.ngMock.TzDate(0, '1970-01-01T00:00:00.000Z').getTime()).toBe(0); -      expect(new angular.module.ngMock.TzDate(0, '2010-09-03T23:05:08.023Z').getTime()).toBe(1283555108023); +      expect(new angular.mock.TzDate(0, '1970-01-01T00:00:00.000Z').getTime()).toBe(0); +      expect(new angular.mock.TzDate(0, '2010-09-03T23:05:08.023Z').getTime()).toBe(1283555108023);      });      it('should fake getLocalDateString method', function() {        //0 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, 0); +      var t0 = new angular.mock.TzDate(-3, 0);        expect(t0.toLocaleDateString()).toMatch('1970');        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, 0); +      var t1 = new angular.mock.TzDate(0, 0);        expect(t1.toLocaleDateString()).toMatch('1970');        //0 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, 0); +      var t2 = new angular.mock.TzDate(3, 0);        expect(t2.toLocaleDateString()).toMatch('1969');      });      it('should fake getHours method', function() {        //0 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, 0); +      var t0 = new angular.mock.TzDate(-3, 0);        expect(t0.getHours()).toBe(3);        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, 0); +      var t1 = new angular.mock.TzDate(0, 0);        expect(t1.getHours()).toBe(0);        //0 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, 0); +      var t2 = new angular.mock.TzDate(3, 0);        expect(t2.getHours()).toMatch(21);      });      it('should fake getMinutes method', function() {        //0:15 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, minutes(15)); +      var t0 = new angular.mock.TzDate(-3, minutes(15));        expect(t0.getMinutes()).toBe(15);        //0:15 in -3.25h -      var t0a = new angular.module.ngMock.TzDate(-3.25, minutes(15)); +      var t0a = new angular.mock.TzDate(-3.25, minutes(15));        expect(t0a.getMinutes()).toBe(30);        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, minutes(0)); +      var t1 = new angular.mock.TzDate(0, minutes(0));        expect(t1.getMinutes()).toBe(0);        //0:15 in +0h -      var t1a = new angular.module.ngMock.TzDate(0, minutes(15)); +      var t1a = new angular.mock.TzDate(0, minutes(15));        expect(t1a.getMinutes()).toBe(15);        //0:15 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, minutes(15)); +      var t2 = new angular.mock.TzDate(3, minutes(15));        expect(t2.getMinutes()).toMatch(15);        //0:15 in +3.25h -      var t2a = new angular.module.ngMock.TzDate(3.25, minutes(15)); +      var t2a = new angular.mock.TzDate(3.25, minutes(15));        expect(t2a.getMinutes()).toMatch(0);      });      it('should fake getSeconds method', function() {        //0 in -3h -      var t0 = new angular.module.ngMock.TzDate(-3, 0); +      var t0 = new angular.mock.TzDate(-3, 0);        expect(t0.getSeconds()).toBe(0);        //0 in +0h -      var t1 = new angular.module.ngMock.TzDate(0, 0); +      var t1 = new angular.mock.TzDate(0, 0);        expect(t1.getSeconds()).toBe(0);        //0 in +3h -      var t2 = new angular.module.ngMock.TzDate(3, 0); +      var t2 = new angular.mock.TzDate(3, 0);        expect(t2.getSeconds()).toMatch(0);      });      it('should create a date representing new year in Bratislava', function() { -      var newYearInBratislava = new angular.module.ngMock.TzDate(-1, '2009-12-31T23:00:00.000Z'); +      var newYearInBratislava = new angular.mock.TzDate(-1, '2009-12-31T23:00:00.000Z');        expect(newYearInBratislava.getTimezoneOffset()).toBe(-60);        expect(newYearInBratislava.getFullYear()).toBe(2010);        expect(newYearInBratislava.getMonth()).toBe(0); @@ -132,7 +132,7 @@ describe('mocks', function() {      it('should delegate all the UTC methods to the original UTC Date object', function() {        //from when created from string -      var date1 = new angular.module.ngMock.TzDate(-1, '2009-12-31T23:00:00.000Z'); +      var date1 = new angular.mock.TzDate(-1, '2009-12-31T23:00:00.000Z');        expect(date1.getUTCFullYear()).toBe(2009);        expect(date1.getUTCMonth()).toBe(11);        expect(date1.getUTCDate()).toBe(31); @@ -142,7 +142,7 @@ describe('mocks', function() {        //from when created from millis -      var date2 = new angular.module.ngMock.TzDate(-1, date1.getTime()); +      var date2 = new angular.mock.TzDate(-1, date1.getTime());        expect(date2.getUTCFullYear()).toBe(2009);        expect(date2.getUTCMonth()).toBe(11);        expect(date2.getUTCDate()).toBe(31); @@ -153,7 +153,7 @@ describe('mocks', function() {      it('should throw error when no third param but toString called', function() { -      expect(function() { new angular.module.ngMock.TzDate(0,0).toString(); }). +      expect(function() { new angular.mock.TzDate(0,0).toString(); }).                             toThrow('Method \'toString\' is not implemented in the TzDate mock');      });    }); @@ -318,8 +318,8 @@ describe('mocks', function() {    }); -  describe('angular.module.ngMock.dump', function(){ -    var d = angular.module.ngMock.dump; +  describe('angular.mock.dump', function(){ +    var d = angular.mock.dump;      it('should serialize primitive types', function(){ @@ -379,7 +379,7 @@ describe('mocks', function() {          function($provide) {            realBackendSpy = jasmine.createSpy('realBackend');            $provide.value('$httpBackend', realBackendSpy); -          $provide.decorator('$httpBackend', angular.module.ngMock.$httpBackendDecorator) +          $provide.decorator('$httpBackend', angular.mock.$httpBackendDecorator)          },          function($httpBackend) {            callback = jasmine.createSpy('callback'); diff --git a/test/loaderSpec.js b/test/loaderSpec.js new file mode 100644 index 00000000..afea159b --- /dev/null +++ b/test/loaderSpec.js @@ -0,0 +1,63 @@ +'use strict'; + +describe('module loader', function() { +  var window; + +  beforeEach(function () { +    window = {}; +    setupModuleLoader(window); +  }); + + +  it('should set up namespace', function() { +    expect(window.angular).toBeDefined(); +    expect(window.angular.module).toBeDefined(); +  }); + + +  it('should not override existing namespace', function() { +    var angular = window.angular; +    var module = angular.module; + +    setupModuleLoader(window); +    expect(window.angular).toBe(angular); +    expect(window.angular.module).toBe(module); +  }); + + +  it('should record calls', function() { +    var otherModule = window.angular.module('other', []); +    otherModule.init('otherInit'); + +    var myModule = window.angular.module('my', ['other'], 'init'); + +    myModule. +      service('sk', 'sv'). +      factory('fk', 'fv'). +      value('k', 'v'). +      filter('f', 'ff'). +      init('init2'); + +    expect(myModule.requires).toEqual(['other']); +    expect(myModule.invokeQueue).toEqual([ +      ['$injector', 'invoke', [null, 'init'] ], +      ['$provide', 'service', ['sk', 'sv'] ], +      ['$provide', 'factory', ['fk', 'fv'] ], +      ['$provide', 'value', ['k', 'v'] ], +      ['$filterProvider', 'register', ['f', 'ff'] ], +      ['$injector', 'invoke', [null, 'init2'] ] +    ]); +  }); + + +  it('should allow module redefinition', function() { +    expect(window.angular.module('a', [])).not.toBe(window.angular.module('a', [])); +  }); + + +  it('should complain of no module', function() { +    expect(function() { +      window.angular.module('dontExist'); +    }).toThrow('No module: dontExist'); +  }); +}); diff --git a/test/scenario/ApplicationSpec.js b/test/scenario/ApplicationSpec.js index 86023438..7384ecaa 100644 --- a/test/scenario/ApplicationSpec.js +++ b/test/scenario/ApplicationSpec.js @@ -116,7 +116,7 @@ describe('angular.scenario.Application', function() {      var called, polled;      var handlers = [];      var testWindow = { -      document: jqLite('<div class="test-foo"></div>'), +      document: jqLite('<div class="test-foo" ng-app></div>')[0],        angular: {          element: jqLite,          service: {} @@ -125,7 +125,7 @@ describe('angular.scenario.Application', function() {      $browser.notifyWhenNoOutstandingRequests = function(fn) {        handlers.push(fn);      }; -    testWindow.document.data('$injector', $injector); +    jqLite(testWindow.document).data('$injector', $injector);      app.getWindow_ = function() {        return testWindow;      }; diff --git a/test/scenario/RunnerSpec.js b/test/scenario/RunnerSpec.js index 8d1f832d..15bcc4b0 100644 --- a/test/scenario/RunnerSpec.js +++ b/test/scenario/RunnerSpec.js @@ -46,8 +46,8 @@ describe('angular.scenario.Runner', function() {      runner.createSpecRunner_ = function(scope) {        return scope.$new(MockSpecRunner);      }; -    runner.on('SpecError', angular.module.ngMock.rethrow); -    runner.on('StepError', angular.module.ngMock.rethrow); +    runner.on('SpecError', angular.mock.rethrow); +    runner.on('StepError', angular.mock.rethrow);    });    afterEach(function() { diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js index 1b0d613c..79d479bb 100644 --- a/test/scenario/dslSpec.js +++ b/test/scenario/dslSpec.js @@ -7,10 +7,10 @@ describe("angular.scenario.dsl", function() {    beforeEach(inject(function($injector) {      eventLog = [];      $window = { -      document: jqLite('<div class="document"></div>'), +      document: window.document.body,        angular: new angular.scenario.testing.MockAngular()      }; -    $window.document.data('$injector', $injector); +    jqLite($window.document).data('$injector', $injector).attr('ng-app', '').addClass('html');      $root = $injector.get('$rootScope');      $root.emit = function(eventName) {        eventLog.push(eventName); @@ -35,7 +35,7 @@ describe("angular.scenario.dsl", function() {          return fn.call($root).apply($root, arguments);        };      }); -    $root.application = new angular.scenario.Application($window.document); +    $root.application = new angular.scenario.Application(jqLite($window.document));      $root.application.getWindow_ = function() {        return $window;      }; @@ -46,6 +46,7 @@ describe("angular.scenario.dsl", function() {      // Just use the real one since it delegates to this.addFuture      $root.addFutureAction = angular.scenario.        SpecRunner.prototype.addFutureAction; +    jqLite($window.document).html('');    }));    afterEach(function(){ @@ -202,27 +203,10 @@ describe("angular.scenario.dsl", function() {    describe('Element Finding', function() {      var doc; -    //TODO(esprehn): Work around a bug in jQuery where attribute selectors -    //  only work if they are executed on a real document, not an element. -    // -    //  ex. jQuery('#foo').find('[name="bar"]') // fails -    //  ex. jQuery('#foo [name="bar"]') // works, wtf? -    //      beforeEach(inject(function($injector) { -      doc = _jQuery('<div id="angular-scenario-binding"></div>'); -      _jQuery(document.body).html('').append(doc); - -      dealoc($window.document); // we are about to override it -      $window.document = window.document; -      jqLite($window.document).data('$injector', $injector); +      doc = _jQuery($window.document).append('<div class="body"></div>').find('.body');      })); -    afterEach(function() { -      _jQuery(document.body). -        find('#angular-scenario-binding'). -        remove(); -    }); -      describe('Select', function() {        it('should select single option', function() {          doc.append( @@ -232,7 +216,7 @@ describe("angular.scenario.dsl", function() {            '</select>'          );          $root.dsl.select('test').option('A'); -        expect(_jQuery('[ng\\:model="test"]').val()).toEqual('A'); +        expect(doc.find('[ng\\:model="test"]').val()).toEqual('A');        });        it('should select option by name', function() { @@ -243,7 +227,7 @@ describe("angular.scenario.dsl", function() {              '</select>'            );            $root.dsl.select('test').option('one'); -          expect(_jQuery('[ng\\:model="test"]').val()).toEqual('A'); +          expect(doc.find('[ng\\:model="test"]').val()).toEqual('A');        });        it('should select multiple options', function() { @@ -255,7 +239,7 @@ describe("angular.scenario.dsl", function() {            '</select>'          );          $root.dsl.select('test').options('A', 'B'); -        expect(_jQuery('[ng\\:model="test"]').val()).toEqual(['A','B']); +        expect(doc.find('[ng\\:model="test"]').val()).toEqual(['A','B']);        });        it('should fail to select multiple options on non-multiple select', function() { @@ -318,7 +302,7 @@ describe("angular.scenario.dsl", function() {        it('should set attribute', function() {          doc.append('<div id="test" class="foo"></div>');          $root.dsl.element('#test').attr('class', 'bam'); -        expect(doc.find('div').attr('class')).toEqual('bam'); +        expect(doc.find('#test').attr('class')).toEqual('bam');        });        it('should get property', function() { @@ -330,7 +314,7 @@ describe("angular.scenario.dsl", function() {        it('should set property', function() {          doc.append('<div id="test" class="foo"></div>');          $root.dsl.element('#test').prop('className', 'bam'); -        expect(doc.find('div').prop('className')).toEqual('bam'); +        expect(doc.find('#test').prop('className')).toEqual('bam');        });        it('should get css', function() { diff --git a/test/scenario/e2e/widgets.html b/test/scenario/e2e/widgets.html index fb27f72e..40ba0a3a 100644 --- a/test/scenario/e2e/widgets.html +++ b/test/scenario/e2e/widgets.html @@ -1,8 +1,8 @@  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  <html xmlns:ng="http://angularjs.org"> -  <head> +  <head ng:app>      <link rel="stylesheet" type="text/css" href="style.css"/> -    <script type="text/javascript" src="../../../src/angular-bootstrap.js" ng:autobind></script> +    <script type="text/javascript" src="../../../src/angular-bootstrap.js"></script>    </head>    <body ng:init="$window.$scope = this">      <table> diff --git a/test/service/cookiesSpec.js b/test/service/cookiesSpec.js index a4db9546..d73923a6 100644 --- a/test/service/cookiesSpec.js +++ b/test/service/cookiesSpec.js @@ -3,7 +3,7 @@  describe('$cookies', function() {    beforeEach(inject(function($provide) {      $provide.factory('$browser', function(){ -      return angular.extend(new angular.module.ngMock.$Browser(), {cookieHash: {preexisting:'oldCookie'}}); +      return angular.extend(new angular.mock.$Browser(), {cookieHash: {preexisting:'oldCookie'}});      });    })); diff --git a/test/service/filter/filtersSpec.js b/test/service/filter/filtersSpec.js index 70497a61..40a78558 100644 --- a/test/service/filter/filtersSpec.js +++ b/test/service/filter/filtersSpec.js @@ -187,10 +187,10 @@ describe('filters', function() {    describe('date', function() { -    var morning  = new angular.module.ngMock.TzDate(+5, '2010-09-03T12:05:08.000Z'); //7am -    var noon =     new angular.module.ngMock.TzDate(+5, '2010-09-03T17:05:08.000Z'); //12pm -    var midnight = new angular.module.ngMock.TzDate(+5, '2010-09-03T05:05:08.000Z'); //12am -    var earlyDate = new angular.module.ngMock.TzDate(+5, '0001-09-03T05:05:08.000Z'); +    var morning  = new angular.mock.TzDate(+5, '2010-09-03T12:05:08.000Z'); //7am +    var noon =     new angular.mock.TzDate(+5, '2010-09-03T17:05:08.000Z'); //12pm +    var midnight = new angular.mock.TzDate(+5, '2010-09-03T05:05:08.000Z'); //12am +    var earlyDate = new angular.mock.TzDate(+5, '0001-09-03T05:05:08.000Z');      var date; diff --git a/test/service/logSpec.js b/test/service/logSpec.js index a26e190f..ee250b66 100644 --- a/test/service/logSpec.js +++ b/test/service/logSpec.js @@ -13,7 +13,7 @@ describe('$log', function() {      $window = {};      logger = '';      $provide.service('$log', $LogProvider); -    $provide.value('$exceptionHandler', angular.module.ngMock.rethrow); +    $provide.value('$exceptionHandler', angular.mock.rethrow);      $provide.value('$window', $window);    })); diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index e21eb64a..632724ce 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -501,14 +501,6 @@ describe('widget', function() {        expect(element.text()).toBe('a|b|||c||d|');      })); -    it('should iterate over all kinds of types', inject(function($rootScope, $compile) { -      var element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); -      $rootScope.array = ['a', 1, null, undefined, {}]; -      $rootScope.$digest(); - -      expect(element.text()).toBe('a|1|||{\n  }|'); -    })); -      it('should iterate over all kinds of types', inject(function($rootScope, $compile) {        var element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); | 
