aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/angular-mocksSpec.js52
-rw-r--r--test/markupSpec.js2
-rw-r--r--test/matchers.js2
-rw-r--r--test/scenario/RunnerSpec.js4
-rw-r--r--test/service/cookiesSpec.js2
-rw-r--r--test/service/filter/filtersSpec.js8
-rw-r--r--test/service/logSpec.js2
-rw-r--r--test/service/scopeSpec.js10
-rw-r--r--test/testabilityPatch.js4
-rw-r--r--test/widgetsSpec.js2
10 files changed, 44 insertions, 44 deletions
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js
index 4073f7fb..acb019c7 100644
--- a/test/angular-mocksSpec.js
+++ b/test/angular-mocksSpec.js
@@ -8,95 +8,95 @@ describe('mocks', function() {
}
it('should look like a Date', function() {
- var date = new angular.module.NG_MOCK.TzDate(0,0);
+ var date = new angular.module.ngMock.TzDate(0,0);
expect(angular.isDate(date)).toBe(true);
});
it('should take millis as constructor argument', function() {
- expect(new angular.module.NG_MOCK.TzDate(0, 0).getTime()).toBe(0);
- expect(new angular.module.NG_MOCK.TzDate(0, 1283555108000).getTime()).toBe(1283555108000);
+ expect(new angular.module.ngMock.TzDate(0, 0).getTime()).toBe(0);
+ expect(new angular.module.ngMock.TzDate(0, 1283555108000).getTime()).toBe(1283555108000);
});
it('should take dateString as constructor argument', function() {
- expect(new angular.module.NG_MOCK.TzDate(0, '1970-01-01T00:00:00.000Z').getTime()).toBe(0);
- expect(new angular.module.NG_MOCK.TzDate(0, '2010-09-03T23:05:08.023Z').getTime()).toBe(1283555108023);
+ 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);
});
it('should fake getLocalDateString method', function() {
//0 in -3h
- var t0 = new angular.module.NG_MOCK.TzDate(-3, 0);
+ var t0 = new angular.module.ngMock.TzDate(-3, 0);
expect(t0.toLocaleDateString()).toMatch('1970');
//0 in +0h
- var t1 = new angular.module.NG_MOCK.TzDate(0, 0);
+ var t1 = new angular.module.ngMock.TzDate(0, 0);
expect(t1.toLocaleDateString()).toMatch('1970');
//0 in +3h
- var t2 = new angular.module.NG_MOCK.TzDate(3, 0);
+ var t2 = new angular.module.ngMock.TzDate(3, 0);
expect(t2.toLocaleDateString()).toMatch('1969');
});
it('should fake getHours method', function() {
//0 in -3h
- var t0 = new angular.module.NG_MOCK.TzDate(-3, 0);
+ var t0 = new angular.module.ngMock.TzDate(-3, 0);
expect(t0.getHours()).toBe(3);
//0 in +0h
- var t1 = new angular.module.NG_MOCK.TzDate(0, 0);
+ var t1 = new angular.module.ngMock.TzDate(0, 0);
expect(t1.getHours()).toBe(0);
//0 in +3h
- var t2 = new angular.module.NG_MOCK.TzDate(3, 0);
+ var t2 = new angular.module.ngMock.TzDate(3, 0);
expect(t2.getHours()).toMatch(21);
});
it('should fake getMinutes method', function() {
//0:15 in -3h
- var t0 = new angular.module.NG_MOCK.TzDate(-3, minutes(15));
+ var t0 = new angular.module.ngMock.TzDate(-3, minutes(15));
expect(t0.getMinutes()).toBe(15);
//0:15 in -3.25h
- var t0a = new angular.module.NG_MOCK.TzDate(-3.25, minutes(15));
+ var t0a = new angular.module.ngMock.TzDate(-3.25, minutes(15));
expect(t0a.getMinutes()).toBe(30);
//0 in +0h
- var t1 = new angular.module.NG_MOCK.TzDate(0, minutes(0));
+ var t1 = new angular.module.ngMock.TzDate(0, minutes(0));
expect(t1.getMinutes()).toBe(0);
//0:15 in +0h
- var t1a = new angular.module.NG_MOCK.TzDate(0, minutes(15));
+ var t1a = new angular.module.ngMock.TzDate(0, minutes(15));
expect(t1a.getMinutes()).toBe(15);
//0:15 in +3h
- var t2 = new angular.module.NG_MOCK.TzDate(3, minutes(15));
+ var t2 = new angular.module.ngMock.TzDate(3, minutes(15));
expect(t2.getMinutes()).toMatch(15);
//0:15 in +3.25h
- var t2a = new angular.module.NG_MOCK.TzDate(3.25, minutes(15));
+ var t2a = new angular.module.ngMock.TzDate(3.25, minutes(15));
expect(t2a.getMinutes()).toMatch(0);
});
it('should fake getSeconds method', function() {
//0 in -3h
- var t0 = new angular.module.NG_MOCK.TzDate(-3, 0);
+ var t0 = new angular.module.ngMock.TzDate(-3, 0);
expect(t0.getSeconds()).toBe(0);
//0 in +0h
- var t1 = new angular.module.NG_MOCK.TzDate(0, 0);
+ var t1 = new angular.module.ngMock.TzDate(0, 0);
expect(t1.getSeconds()).toBe(0);
//0 in +3h
- var t2 = new angular.module.NG_MOCK.TzDate(3, 0);
+ var t2 = new angular.module.ngMock.TzDate(3, 0);
expect(t2.getSeconds()).toMatch(0);
});
it('should create a date representing new year in Bratislava', function() {
- var newYearInBratislava = new angular.module.NG_MOCK.TzDate(-1, '2009-12-31T23:00:00.000Z');
+ var newYearInBratislava = new angular.module.ngMock.TzDate(-1, '2009-12-31T23:00:00.000Z');
expect(newYearInBratislava.getTimezoneOffset()).toBe(-60);
expect(newYearInBratislava.getFullYear()).toBe(2010);
expect(newYearInBratislava.getMonth()).toBe(0);
@@ -108,7 +108,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.NG_MOCK.TzDate(-1, '2009-12-31T23:00:00.000Z');
+ var date1 = new angular.module.ngMock.TzDate(-1, '2009-12-31T23:00:00.000Z');
expect(date1.getUTCFullYear()).toBe(2009);
expect(date1.getUTCMonth()).toBe(11);
expect(date1.getUTCDate()).toBe(31);
@@ -118,7 +118,7 @@ describe('mocks', function() {
//from when created from millis
- var date2 = new angular.module.NG_MOCK.TzDate(-1, date1.getTime());
+ var date2 = new angular.module.ngMock.TzDate(-1, date1.getTime());
expect(date2.getUTCFullYear()).toBe(2009);
expect(date2.getUTCMonth()).toBe(11);
expect(date2.getUTCDate()).toBe(31);
@@ -129,7 +129,7 @@ describe('mocks', function() {
it('should throw error when no third param but toString called', function() {
- expect(function() { new angular.module.NG_MOCK.TzDate(0,0).toString(); }).
+ expect(function() { new angular.module.ngMock.TzDate(0,0).toString(); }).
toThrow('Method \'toString\' is not implemented in the TzDate mock');
});
});
@@ -290,8 +290,8 @@ describe('mocks', function() {
});
- describe('angular.module.NG_MOCK.dump', function(){
- var d = angular.module.NG_MOCK.dump;
+ describe('angular.module.ngMock.dump', function(){
+ var d = angular.module.ngMock.dump;
it('should serialize primitive types', function(){
diff --git a/test/markupSpec.js b/test/markupSpec.js
index f93acb98..8f68ee82 100644
--- a/test/markupSpec.js
+++ b/test/markupSpec.js
@@ -150,7 +150,7 @@ describe("markups", function() {
it('should bind Text with no Bindings', inject(function($compile) {
var $rootScope;
function newScope (){
- return $rootScope = angular.injector('NG')('$rootScope');
+ return $rootScope = angular.injector('ng')('$rootScope');
}
forEach(['checked', 'disabled', 'multiple', 'readonly', 'selected'], function(name) {
var element = $compile('<div ng:' + name + '="some"></div>')(newScope())
diff --git a/test/matchers.js b/test/matchers.js
index e7fd202a..9cd582e1 100644
--- a/test/matchers.js
+++ b/test/matchers.js
@@ -95,7 +95,7 @@ beforeEach(function() {
toHaveClass: function(clazz) {
this.message = function() {
- return "Expected '" + angular.module.NG_MOCK.dump(this.actual) + "' to have class '" + clazz + "'.";
+ return "Expected '" + angular.module.ngMock.dump(this.actual) + "' to have class '" + clazz + "'.";
};
return this.actual.hasClass ?
this.actual.hasClass(clazz) :
diff --git a/test/scenario/RunnerSpec.js b/test/scenario/RunnerSpec.js
index db47db87..8d1f832d 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.NG_MOCK.rethrow);
- runner.on('StepError', angular.module.NG_MOCK.rethrow);
+ runner.on('SpecError', angular.module.ngMock.rethrow);
+ runner.on('StepError', angular.module.ngMock.rethrow);
});
afterEach(function() {
diff --git a/test/service/cookiesSpec.js b/test/service/cookiesSpec.js
index c619cf1a..a4db9546 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.NG_MOCK.$Browser(), {cookieHash: {preexisting:'oldCookie'}});
+ return angular.extend(new angular.module.ngMock.$Browser(), {cookieHash: {preexisting:'oldCookie'}});
});
}));
diff --git a/test/service/filter/filtersSpec.js b/test/service/filter/filtersSpec.js
index 275dbab4..70497a61 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.NG_MOCK.TzDate(+5, '2010-09-03T12:05:08.000Z'); //7am
- var noon = new angular.module.NG_MOCK.TzDate(+5, '2010-09-03T17:05:08.000Z'); //12pm
- var midnight = new angular.module.NG_MOCK.TzDate(+5, '2010-09-03T05:05:08.000Z'); //12am
- var earlyDate = new angular.module.NG_MOCK.TzDate(+5, '0001-09-03T05:05:08.000Z');
+ 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 date;
diff --git a/test/service/logSpec.js b/test/service/logSpec.js
index e81ac851..a26e190f 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.NG_MOCK.rethrow);
+ $provide.value('$exceptionHandler', angular.module.ngMock.rethrow);
$provide.value('$window', $window);
}));
diff --git a/test/service/scopeSpec.js b/test/service/scopeSpec.js
index 88824fcd..54c835f5 100644
--- a/test/service/scopeSpec.js
+++ b/test/service/scopeSpec.js
@@ -285,7 +285,7 @@ describe('Scope', function() {
it('should return a function that allows listeners to be unregistered', inject(function($rootScope) {
- var root = angular.injector('NG')('$rootScope'),
+ var root = angular.injector('ng')('$rootScope'),
listener = jasmine.createSpy('watch listener'),
listenerRemove;
@@ -470,7 +470,7 @@ describe('Scope', function() {
it('should add listener for both $emit and $broadcast events', inject(function($rootScope) {
var log = '',
- root = angular.injector('NG')('$rootScope'),
+ root = angular.injector('ng')('$rootScope'),
child = root.$new();
function eventFn() {
@@ -490,7 +490,7 @@ describe('Scope', function() {
it('should return a function that deregisters the listener', inject(function($rootScope) {
var log = '',
- root = angular.injector('NG')('$rootScope'),
+ root = angular.injector('ng')('$rootScope'),
child = root.$new(),
listenerRemove;
@@ -669,7 +669,7 @@ describe('Scope', function() {
describe('listener', function() {
it('should receive event object', inject(function($rootScope) {
- var scope = angular.injector('NG')('$rootScope'),
+ var scope = angular.injector('ng')('$rootScope'),
child = scope.$new(),
event;
@@ -685,7 +685,7 @@ describe('Scope', function() {
it('should support passing messages as varargs', inject(function($rootScope) {
- var scope = angular.injector('NG')('$rootScope'),
+ var scope = angular.injector('ng')('$rootScope'),
child = scope.$new(),
args;
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index b43d9b87..ad39e2fd 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -175,11 +175,11 @@ function isCssVisible(node) {
function assertHidden(node) {
assertFalse("Node should be hidden but vas visible: " +
- angular.module.NG_MOCK.dump(node), isCssVisible(node));
+ angular.module.ngMock.dump(node), isCssVisible(node));
}
function assertVisible(node) {
assertTrue("Node should be visible but vas hidden: " +
- angular.module.NG_MOCK.dump(node), isCssVisible(node));
+ angular.module.ngMock.dump(node), isCssVisible(node));
}
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index 63182374..2bb7bac2 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -506,7 +506,7 @@ describe("widget", function() {
}));
it('should be possible to nest ng:view in ng:include', inject(function() {
- var injector = angular.injector('NG', 'NG_MOCK');
+ var injector = angular.injector('ng', 'ngMock');
var myApp = injector('$rootScope');
var $browser = injector('$browser');
$browser.xhr.expectGET('includePartial.html').respond('view: <ng:view></ng:view>');