From c808faced55b3886c59fec7ea8a83cd3b9fba2ee Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 18:18:51 +0530 Subject: [PATCH 1/6] Add javascript dependencies in the bower.json --- bower.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index f5d10c0..2bd074b 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { - "name": "CommunityCalendar", + "name": "bower", "version": "0.1", "private": true, "ignore": [ @@ -11,6 +11,9 @@ ], "dependencies": { "angular": "", - "angular-route": "~1.4.8" + "angular-route": "~1.4.8", + "angular-ui-router": "", + "angular-bootstrap": "", + "bootstrap": "" } } From 307c5c8d1192f61e6148ba9d1ff1f3fb2c63cfb9 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 18:25:18 +0530 Subject: [PATCH 2/6] Add the node dependencies in the package.json --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 56b857e..182b929 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,10 @@ "body-parser": "", "serve-static": "", "errorhandler": "", - "bower": "" + "bower": "", + "jasmine-node": "", + "frisby": "", + "karma": "" }, "production_dirs": { "coffee_src": "src/", From 04fbc3df16a7c5c6086edc33474674eac049055d Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Sat, 2 Jul 2016 19:15:17 +0530 Subject: [PATCH 3/6] Add the angular-mocks.js for running the e2e tests. --- test/e2e/runner.html | 1 + test/e2e/seed-runner.html | 1 + 2 files changed, 2 insertions(+) diff --git a/test/e2e/runner.html b/test/e2e/runner.html index eca443c..9f241af 100644 --- a/test/e2e/runner.html +++ b/test/e2e/runner.html @@ -4,6 +4,7 @@ End2end Test Runner + diff --git a/test/e2e/seed-runner.html b/test/e2e/seed-runner.html index 9ed5528..e5a8b3c 100644 --- a/test/e2e/seed-runner.html +++ b/test/e2e/seed-runner.html @@ -4,6 +4,7 @@ End2end Test Runner + From b9ec6a3bc996bf96190bd687f4e12262a655a6fa Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 13:38:02 +0530 Subject: [PATCH 4/6] Add support for running tests from npm test command. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 182b929..5a10649 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "devDependencies": { }, "scripts": { - "postinstall": "bower install" + "postinstall": "bower install", + "test": "jasmine-node --verbose test" } } From a8f33b498fcca269c47190903ec89a1ba49154a2 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 13:40:29 +0530 Subject: [PATCH 5/6] Remove the files from test/unit as they are unrelated. --- test/unit/controllersSpec.js | 16 ---------------- test/unit/directivesSpec.js | 19 ------------------- test/unit/filtersSpec.js | 19 ------------------- test/unit/servicesSpec.coffee | 7 ------- 4 files changed, 61 deletions(-) delete mode 100644 test/unit/controllersSpec.js delete mode 100644 test/unit/directivesSpec.js delete mode 100644 test/unit/filtersSpec.js delete mode 100644 test/unit/servicesSpec.coffee diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js deleted file mode 100644 index 23f6b09..0000000 --- a/test/unit/controllersSpec.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/* jasmine specs for controllers go here */ - -describe('controllers', function(){ - beforeEach(module('myApp.controllers')); - - - it('should ....', inject(function() { - //spec body - })); - - it('should ....', inject(function() { - //spec body - })); -}); diff --git a/test/unit/directivesSpec.js b/test/unit/directivesSpec.js deleted file mode 100644 index 6061842..0000000 --- a/test/unit/directivesSpec.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/* jasmine specs for directives go here */ - -describe('directives', function() { - beforeEach(module('myApp.directives')); - - describe('app-version', function() { - it('should print current version', function() { - module(function($provide) { - $provide.value('version', 'TEST_VER'); - }); - inject(function($compile, $rootScope) { - var element = $compile('')($rootScope); - expect(element.text()).toEqual('TEST_VER'); - }); - }); - }); -}); diff --git a/test/unit/filtersSpec.js b/test/unit/filtersSpec.js deleted file mode 100644 index 19af329..0000000 --- a/test/unit/filtersSpec.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/* jasmine specs for filters go here */ - -describe('filter', function() { - beforeEach(module('myApp.filters')); - - - describe('interpolate', function() { - beforeEach(module(function($provide) { - $provide.value('version', 'TEST_VER'); - })); - - - it('should replace VERSION', inject(function(interpolateFilter) { - expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after'); - })); - }); -}); diff --git a/test/unit/servicesSpec.coffee b/test/unit/servicesSpec.coffee deleted file mode 100644 index 79a9888..0000000 --- a/test/unit/servicesSpec.coffee +++ /dev/null @@ -1,7 +0,0 @@ -# jasmine specs for services go here - -describe 'service', -> - beforeEach module 'myApp.services' - describe 'version', -> - it 'should return current version', inject (version) -> - expect(version).toEqual('0.1') From 3c410dc3f05ece1cd49889cf98eab4a7dbb53736 Mon Sep 17 00:00:00 2001 From: ajinkya007 Date: Thu, 7 Jul 2016 14:00:18 +0530 Subject: [PATCH 6/6] Remove angular-seed files from the project directory. --- .travis.yml | 14 ---------- app/index.html | 2 +- app/js/seed-app.js | 11 -------- app/js/seed-controllers.js | 11 -------- app/js/seed-directives.js | 11 -------- app/js/seed-filters.js | 10 -------- app/js/seed-services.js | 9 ------- app/partials/seed-partial1.html | 1 - app/partials/seed-partial2.html | 5 ---- app/seed-index.html | 28 -------------------- test/e2e/seed-runner.html | 12 --------- test/e2e/seed-scenarios.js | 45 --------------------------------- 12 files changed, 1 insertion(+), 158 deletions(-) delete mode 100644 .travis.yml delete mode 100644 app/js/seed-app.js delete mode 100644 app/js/seed-controllers.js delete mode 100644 app/js/seed-directives.js delete mode 100644 app/js/seed-filters.js delete mode 100644 app/js/seed-services.js delete mode 100644 app/partials/seed-partial1.html delete mode 100644 app/partials/seed-partial2.html delete mode 100644 app/seed-index.html delete mode 100644 test/e2e/seed-runner.html delete mode 100644 test/e2e/seed-scenarios.js diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f55d7f5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - 0.8 - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - npm install --quiet -g karma - - ./scripts/web-server.js > /dev/null & - - sleep 1 # give server time to start - -script: - - karma start config/karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox - - karma start config/karma-e2e.conf.js --reporters=dots --browsers=Firefox diff --git a/app/index.html b/app/index.html index fc3a540..8d9ab40 100644 --- a/app/index.html +++ b/app/index.html @@ -10,11 +10,11 @@ + - diff --git a/app/js/seed-app.js b/app/js/seed-app.js deleted file mode 100644 index d32c16e..0000000 --- a/app/js/seed-app.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -// Declare app level module which depends on filters, and services -angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'myApp.controllers']). - config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/view1', {templateUrl: 'partials/seed-partial1.html', controller: 'MyCtrl1'}); - $routeProvider.when('/view2', {templateUrl: 'partials/seed-partial2.html', controller: 'MyCtrl2'}); - $routeProvider.otherwise({redirectTo: '/view1'}); - }]); - diff --git a/app/js/seed-controllers.js b/app/js/seed-controllers.js deleted file mode 100644 index 35dc54d..0000000 --- a/app/js/seed-controllers.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/* Controllers */ - -angular.module('myApp.controllers', []). - controller('MyCtrl1', [function() { - - }]) - .controller('MyCtrl2', [function() { - - }]); diff --git a/app/js/seed-directives.js b/app/js/seed-directives.js deleted file mode 100644 index 9fc16cc..0000000 --- a/app/js/seed-directives.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/* Directives */ - - -angular.module('myApp.directives', []). - directive('appVersion', ['version', function(version) { - return function(scope, elm, attrs) { - elm.text(version); - }; - }]); diff --git a/app/js/seed-filters.js b/app/js/seed-filters.js deleted file mode 100644 index 259dd4e..0000000 --- a/app/js/seed-filters.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/* Filters */ - -angular.module('myApp.filters', []). - filter('interpolate', ['version', function(version) { - return function(text) { - return String(text).replace(/\%VERSION\%/mg, version); - } - }]); diff --git a/app/js/seed-services.js b/app/js/seed-services.js deleted file mode 100644 index 334d543..0000000 --- a/app/js/seed-services.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -/* Services */ - - -// Demonstrate how to register services -// In this case it is a simple value service. -angular.module('myApp.services', []). - value('version', '0.1'); diff --git a/app/partials/seed-partial1.html b/app/partials/seed-partial1.html deleted file mode 100644 index 89459a6..0000000 --- a/app/partials/seed-partial1.html +++ /dev/null @@ -1 +0,0 @@ -

This is the partial for view 1.

diff --git a/app/partials/seed-partial2.html b/app/partials/seed-partial2.html deleted file mode 100644 index b6503ee..0000000 --- a/app/partials/seed-partial2.html +++ /dev/null @@ -1,5 +0,0 @@ -

This is the partial for view 2.

-

- Showing of 'interpolate' filter: - {{ 'Current version is v%VERSION%.' | interpolate }} -

diff --git a/app/seed-index.html b/app/seed-index.html deleted file mode 100644 index 25d1f4e..0000000 --- a/app/seed-index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - My AngularJS App - - - - - -
- -
Angular seed app: v
- - - - - - - - - - diff --git a/test/e2e/seed-runner.html b/test/e2e/seed-runner.html deleted file mode 100644 index e5a8b3c..0000000 --- a/test/e2e/seed-runner.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - End2end Test Runner - - - - - - - - diff --git a/test/e2e/seed-scenarios.js b/test/e2e/seed-scenarios.js deleted file mode 100644 index eb6e957..0000000 --- a/test/e2e/seed-scenarios.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */ - -describe('my app', function() { - - beforeEach(function() { - browser().navigateTo('/seed-index.html'); - }); - - - it('should automatically redirect to /view1 when location hash/fragment is empty', function() { - expect(browser().location().url()).toBe("/view1"); - }); - - - describe('view1', function() { - - beforeEach(function() { - browser().navigateTo('#/view1'); - }); - - - it('should render view1 when user navigates to /view1', function() { - expect(element('[ng-view] p:first').text()). - toMatch(/partial for view 1/); - }); - - }); - - - describe('view2', function() { - - beforeEach(function() { - browser().navigateTo('#/view2'); - }); - - - it('should render view2 when user navigates to /view2', function() { - expect(element('[ng-view] p:first').text()). - toMatch(/partial for view 2/); - }); - - }); -});