diff options
Diffstat (limited to 'js')
74 files changed, 1544 insertions, 1351 deletions
diff --git a/js/package.json b/js/package.json index 9627dc96b..a9b593510 100644 --- a/js/package.json +++ b/js/package.json @@ -31,18 +31,18 @@ "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-uglify": "^0.6.0", "grunt-contrib-watch": "^0.6.1", - "grunt-ng-annotate": "^0.6.0", + "grunt-ng-annotate": "^0.8.0", "grunt-php": "^1.1.1", "grunt-phpunit": "^0.3.6", "grunt-protractor-runner": "^1.1.4", - "grunt-protractor-webdriver": "^0.1.9", + "grunt-protractor-webdriver": "^0.2.0", "grunt-wrap": "^0.3.0", "grunt-karma": "^0.9.0", - "karma": "^0.12.25", - "karma-chrome-launcher": "^0.1.5", - "karma-coverage": "^0.2.6", + "karma": "^0.12.28", + "karma-chrome-launcher": "^0.1.7", + "karma-coverage": "^0.2.7", "karma-firefox-launcher": "^0.1.3", - "karma-jasmine": "^0.1.5" + "karma-jasmine": "^0.3.2" }, "dependencies": {} } diff --git a/js/tests/unit/controller/ContentControllerSpec.js b/js/tests/unit/controller/ContentControllerSpec.js index 25314e561..decdceeab 100644 --- a/js/tests/unit/controller/ContentControllerSpec.js +++ b/js/tests/unit/controller/ContentControllerSpec.js @@ -108,8 +108,8 @@ describe('ContentController', function () { expect(ItemResource.markItemRead).toHaveBeenCalledWith(3); expect(FeedResource.markItemOfFeedRead).toHaveBeenCalledWith(4); - expect(ItemResource.markItemRead.callCount).toBe(1); - expect(FeedResource.markItemOfFeedRead.callCount).toBe(1); + expect(ItemResource.markItemRead.calls.count()).toBe(1); + expect(FeedResource.markItemOfFeedRead.calls.count()).toBe(1); })); @@ -302,7 +302,7 @@ describe('ContentController', function () { Publisher.subscribe(ItemResource).toChannels(['items']); ItemResource.autoPage = jasmine.createSpy('autoPage') - .andCallFake(function () { + .and.callFake(function () { return { success: function (callback) { callback({ @@ -360,7 +360,7 @@ describe('ContentController', function () { Publisher.subscribe(ItemResource).toChannels(['items']); ItemResource.autoPage = jasmine.createSpy('autoPage') - .andCallFake(function () { + .and.callFake(function () { return { success: function (callback) { callback({ @@ -412,7 +412,7 @@ describe('ContentController', function () { Publisher.subscribe(ItemResource).toChannels(['items']); ItemResource.autoPage = jasmine.createSpy('autoPage') - .andCallFake(function () { + .and.callFake(function () { return { success: function (callback) { callback({ diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js index 72b9fe736..994414307 100644 --- a/js/tests/unit/controller/NavigationControllerSpec.js +++ b/js/tests/unit/controller/NavigationControllerSpec.js @@ -70,7 +70,7 @@ describe('NavigationController', function () { controller.markFolderRead(3); expect(FeedResource.markFolderRead).toHaveBeenCalledWith(3); - expect(ItemResource.markFeedRead.callCount).toBe(2); + expect(ItemResource.markFeedRead.calls.count()).toBe(2); })); @@ -317,7 +317,7 @@ describe('NavigationController', function () { it('should create a feed with a folderId', inject(function ($controller) { var FeedResource = { - create: jasmine.createSpy('create').andCallFake( + create: jasmine.createSpy('create').and.callFake( function (url, folderId) { return { then: function (callback) { @@ -378,7 +378,7 @@ describe('NavigationController', function () { it('should create a feed with a foldername', inject(function ($controller) { var FeedResource = { - create: jasmine.createSpy('create').andCallFake( + create: jasmine.createSpy('create').and.callFake( function (url, folderId) { return { then: function (callback) { @@ -398,7 +398,7 @@ describe('NavigationController', function () { }; var FolderResource = { - create: jasmine.createSpy('create').andCallFake(function (folder) { + create: jasmine.createSpy('create').and.callFake(function (folder) { return { then: function (callback) { callback({ @@ -410,7 +410,7 @@ describe('NavigationController', function () { } }; }), - get: jasmine.createSpy('get').andCallFake(function (name) { + get: jasmine.createSpy('get').and.callFake(function (name) { return { name: name, id: 19 @@ -459,7 +459,7 @@ describe('NavigationController', function () { it('should create a folder', inject(function ($controller) { var FolderResource = { - create: jasmine.createSpy('create').andCallFake( + create: jasmine.createSpy('create').and.callFake( function (folder) { return { then: function (callback) { @@ -633,7 +633,7 @@ describe('NavigationController', function () { it('should rename a folder', inject(function ($controller, FolderResource) { FolderResource.rename = jasmine.createSpy('rename') - .andCallFake(function () { + .and.callFake(function () { return { then: function (success) { success(); @@ -668,7 +668,7 @@ describe('NavigationController', function () { it('should handle rename folder error', inject(function ($controller, FolderResource) { FolderResource.rename = jasmine.createSpy('rename') - .andCallFake(function () { + .and.callFake(function () { return { then: function (success, error) { error('no'); @@ -728,7 +728,7 @@ describe('NavigationController', function () { $controller, FeedResource, $q, $rootScope) { var deferred = $q.defer(); FeedResource.reversiblyDelete = jasmine.createSpy('reversiblyDelete') - .andReturn(deferred.promise); + .and.returnValue(deferred.promise); var route = { reload: jasmine.createSpy('reload') }; @@ -759,7 +759,7 @@ describe('NavigationController', function () { $controller, FeedResource, $q, $rootScope) { var deferred = $q.defer(); FeedResource.undoDelete = jasmine.createSpy('undoDelete') - .andReturn(deferred.promise); + .and.returnValue(deferred.promise); var route = { reload: jasmine.createSpy('reload') }; @@ -810,10 +810,10 @@ describe('NavigationController', function () { var deferredFolder = $q.defer(); FolderResource.reversiblyDelete = jasmine.createSpy('reversiblyDelete') - .andReturn(deferredFolder.promise); + .and.returnValue(deferredFolder.promise); FeedResource.reversiblyDeleteFolder = jasmine.createSpy('reversiblyDelete') - .andReturn(deferredFolder.promise); + .and.returnValue(deferredFolder.promise); var route = { reload: jasmine.createSpy('reload') @@ -849,9 +849,9 @@ describe('NavigationController', function () { var deferredFeed = $q.defer(); var deferredFolder = $q.defer(); FolderResource.undoDelete = jasmine.createSpy('undoDelete') - .andReturn(deferredFolder.promise); + .and.returnValue(deferredFolder.promise); FeedResource.undoDeleteFolder = jasmine.createSpy('undoDelete') - .andReturn(deferredFeed.promise); + .and.returnValue(deferredFeed.promise); var route = { reload: jasmine.createSpy('reload') }; diff --git a/js/tests/unit/controller/SettingsControllerSpec.js b/js/tests/unit/controller/SettingsControllerSpec.js index 83c706738..4214f9d81 100644 --- a/js/tests/unit/controller/SettingsControllerSpec.js +++ b/js/tests/unit/controller/SettingsControllerSpec.js @@ -56,7 +56,7 @@ describe('SettingsController', function () { expect(SettingsResource.set).toHaveBeenCalledWith('showAll', false); expect(route.reload).toHaveBeenCalled(); - expect(route.reload.callCount).toBe(2); + expect(route.reload.calls.count()).toBe(2); })); @@ -64,7 +64,7 @@ describe('SettingsController', function () { Publisher) { var data = 1; ItemResource.importArticles = jasmine.createSpy('importArticles') - .andCallFake(function () { + .and.callFake(function () { return { success: function (callback) { callback(data); @@ -112,10 +112,10 @@ describe('SettingsController', function () { OPMLParser) { var queue = 4; - OPMLParser.parse = jasmine.createSpy('parse').andReturn(2); + OPMLParser.parse = jasmine.createSpy('parse').and.returnValue(2); OPMLImporter.importFolders = jasmine.createSpy('importFolders') - .andReturn({ + .and.returnValue({ then: function (callback) { callback(queue, 5); return { @@ -147,7 +147,7 @@ describe('SettingsController', function () { it('should display import opml error', inject(function ( $controller, OPMLParser) { - OPMLParser.parse = jasmine.createSpy('parse').andCallFake(function () { + OPMLParser.parse = jasmine.createSpy('parse').and.callFake(function () { throw 1; }); diff --git a/js/vendor/ |