From 0871c70788c2188249ad6500a21f8d87031dee95 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Sun, 23 Apr 2017 13:11:30 -0700 Subject: [PATCH] got angular unit tests to pass --- bower.json | 14 +++++------ gruntfile.js | 4 ++-- package.json | 2 +- public/config.js | 4 ++-- .../admin/views/admin-form.client.view.html | 2 +- .../cgBusy/update-form-message-TypeA.html | 3 --- .../cgBusy/update-form-message-TypeB.html | 4 ---- .../list-forms.client.controller.test.js | 4 +--- .../unit/services/user.client.service.test.js | 24 +++++++++---------- 9 files changed, 26 insertions(+), 35 deletions(-) delete mode 100644 public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html delete mode 100644 public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html diff --git a/bower.json b/bower.json index dc74ae50..4456d9dc 100755 --- a/bower.json +++ b/bower.json @@ -2,11 +2,11 @@ "name": "tellform", "description": "Opensource alternative to TypeForm", "version": "2.0.0", - "homepage": "https://github.com/whitef0x0/tellform", + "homepage": "https://github.com/whitef0x0/tellform", "authors": [ "David Baldwynn (http://baldwynn.me)" ], - "license": "MIT", + "license": "MIT", "private": true, "appPath": "public/modules", "dependencies": { @@ -26,14 +26,13 @@ "angular-bootstrap-colorpicker": "~3.0.19", "angular-ui-router-tabs": "~1.7.0", "angular-scroll": "^1.0.0", - "angular-sanitize": "^1.5.3", + "angular-sanitize": "1.4.14", "v-button": "^1.1.1", - "angular-busy": "^4.1.3", - "angular-input-stars": "https://github.com/whitef0x0/angular-input-stars.git#master", + "angular-input-stars": "https://github.com/tellform/angular-input-stars.git#master", "raven-js": "^3.0.4", "tableExport.jquery.plugin": "^1.5.1", "js-yaml": "^3.6.1", - "angular-ui-select": "https://github.com/whitef0x0/ui-select.git#compiled", + "angular-ui-select": "https://github.com/tellform/ui-select.git#compiled", "angular-translate": "~2.11.0", "ng-translate": "*", "deep-diff": "^0.3.4", @@ -48,7 +47,8 @@ "angular-bootstrap": "^0.14.0", "angular": "1.4.14", "angular-ui-select": "compiled", - "jspdf": "~1.0.178" + "jspdf": "~1.0.178", + "angular-sanitize": "1.4.14" }, "overrides": { "BOWER-PACKAGE": { diff --git a/gruntfile.js b/gruntfile.js index 405e1262..219b02b6 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -329,7 +329,7 @@ module.exports = function(grunt) { grunt.option('force', true); // A Task for loading the configuration object - /*grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() { + grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() { require('./config/init')(); var config = require('./config/config'); console.log(config); @@ -337,7 +337,7 @@ module.exports = function(grunt) { grunt.config.set('applicationJavaScriptFiles', config.assets.js); grunt.config.set('formApplicationJavaScriptFiles', config.assets.form_js); grunt.config.set('applicationCSSFiles', config.assets.css); - });*/ + }); // Code coverage tasks. grunt.registerTask('coveralls', ['env:test','mocha_istanbul:coveralls']); diff --git a/package.json b/package.json index b7357a7d..8cf6f27c 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "socket.io-redis": "^1.0.0", "swig": "~1.4.1", "uuid-token-generator": "^0.5.0", - "wildcard-subdomains": "github:whitef0x0/wildcard-subdomains" + "wildcard-subdomains": "github:tellform/wildcard-subdomains" }, "devDependencies": { "all-contributors-cli": "^4.3.0", diff --git a/public/config.js b/public/config.js index bc0a2fee..88d06e35 100755 --- a/public/config.js +++ b/public/config.js @@ -1,10 +1,10 @@ 'use strict'; // Init the application configuration module for AngularJS application -(function() { +var ApplicationConfiguration = (function() { // Init module configuration options var applicationModuleName = 'NodeForm'; - var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource', 'TellForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate']; + var applicationModuleVendorDependencies = ['duScroll', 'ui.select', 'ngSanitize', 'vButton', 'ngResource', 'TellForm.templates', 'ui.router', 'ui.bootstrap', 'ui.utils', 'pascalprecht.translate']; // Add a new vertical module var registerModule = function(moduleName, dependencies) { diff --git a/public/modules/forms/admin/views/admin-form.client.view.html b/public/modules/forms/admin/views/admin-form.client.view.html index 165faf31..5227bbae 100644 --- a/public/modules/forms/admin/views/admin-form.client.view.html +++ b/public/modules/forms/admin/views/admin-form.client.view.html @@ -1,6 +1,6 @@
-
+
diff --git a/public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html b/public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html deleted file mode 100644 index 23050ded..00000000 --- a/public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeA.html +++ /dev/null @@ -1,3 +0,0 @@ -
-
{{$message}}
-
diff --git a/public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html b/public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html deleted file mode 100644 index 714ff288..00000000 --- a/public/modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html +++ /dev/null @@ -1,4 +0,0 @@ - -
-
{{$message}}
-
\ No newline at end of file diff --git a/public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js b/public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js index fa96a052..6f591280 100644 --- a/public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js +++ b/public/modules/forms/tests/unit/controllers/list-forms.client.controller.test.js @@ -90,7 +90,7 @@ // The injector ignores leading and trailing underscores here (i.e. _$httpBackend_). // This allows us to inject a service but then attach it to a variable // with the same name as the service. - beforeEach(inject(function($controller, $rootScope, _$state_, _$location_, _$stateParams_, _$httpBackend_, CurrentForm) { + beforeEach(inject(function($controller, $rootScope, _$state_, _$httpBackend_, CurrentForm) { // Set a new global scope scope = $rootScope.$new(); @@ -98,9 +98,7 @@ CurrentForm.setForm(sampleForm); // Point global variables to injected services - $stateParams = _$stateParams_; $httpBackend = _$httpBackend_; - $location = _$location_; $state = _$state_; $httpBackend.whenGET(/\.html$/).respond(''); diff --git a/public/modules/users/tests/unit/services/user.client.service.test.js b/public/modules/users/tests/unit/services/user.client.service.test.js index 2d28e4ba..601ff20e 100644 --- a/public/modules/users/tests/unit/services/user.client.service.test.js +++ b/public/modules/users/tests/unit/services/user.client.service.test.js @@ -22,12 +22,12 @@ var sampleForgotToken = 'c2e8f74455cdccc454dfef941ff315fa4f7b1f0a'; var sampleCredentials = { username: sampleUser.username, - password: sampleUser.password, + password: sampleUser.password }; var samplePasswordDetails = { newPassword: sampleUser.password, - verifyPassword: sampleUser.password, + verifyPassword: sampleUser.password }; // The $resource service augments the response object with methods for updating and deleting the resource. @@ -65,7 +65,7 @@ })); it('User.login() should send a POST request to /auth/signin', function() { - + //Set POST response $httpBackend.expect('POST', '/auth/signin', sampleCredentials).respond(200, sampleUser); @@ -76,7 +76,7 @@ }); it('User.logout() should logout user with /auth/signout', function() { - + //Set POST response $httpBackend.expect('GET', '/auth/signout').respond(200); @@ -87,7 +87,7 @@ }); it('User.getCurrent() should fetch user from /users/me', function() { - + //Set POST response $httpBackend.expect('GET', '/users/me').respond(200, sampleUser); @@ -99,7 +99,7 @@ it('User.signup() should signup user with /auth/signup', function() { - + //Set POST response $httpBackend.expect('POST', '/auth/signup', sampleCredentials).respond(200); @@ -110,7 +110,7 @@ }); it('User.resendVerifyEmail() should send POST request to /auth/verify', function() { - + //Set POST response $httpBackend.expect('POST', '/auth/verify', {email: sampleUser.email}).respond(200); @@ -121,7 +121,7 @@ }); it('User.validateVerifyToken() should send GET request to /auth/verify/:token', function() { - + //Set POST response $httpBackend.expect('GET', '/auth/verify/'+sampleVerifyToken).respond(200); @@ -132,9 +132,9 @@ }); it('User.resetPassword() should send GET request to /auth/forgot/:token', function() { - + //Set POST response - $httpBackend.expect('GET', '/auth/password/'+sampleForgotToken).respond(200); + $httpBackend.expect('POST', '/auth/reset/'+sampleForgotToken).respond(200); //Run Service Logic to Test User.resetPassword(samplePasswordDetails, sampleForgotToken); @@ -143,7 +143,7 @@ }); it('User.askForPasswordReset() should send POST request to /auth/forgot', function() { - + //Set POST response $httpBackend.expect('POST', '/auth/forgot', sampleCredentials).respond(200, sampleUser); @@ -155,4 +155,4 @@ }); -}()); \ No newline at end of file +}());