-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from YashdalfTheGray/master
Merging master into stable for release milestone
- Loading branch information
Showing
27 changed files
with
1,402 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Karma configuration | ||
// Generated on Mon May 25 2015 16:54:36 GMT+0530 (IST) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['jasmine'], | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'src/lib/angular/angular.js', | ||
'src/lib/angular-mocks/angular-mocks.js', | ||
'src/lib/angular-ui-router/release/angular-ui-router.js', | ||
'src/lib/angular-animate/angular-animate.js', | ||
'src/lib/angular-aria/angular-aria.js', | ||
'src/lib/angular-material/angular-material.js', | ||
'src/lib/angular-material/angular-material-mocks.js', | ||
'src/lib/moment/moment.js', | ||
'src/lib/lodash/lodash.js', | ||
'src/app.js', | ||
'src/ideas/ideaSvc/ideaSvc.mock.js', | ||
'src/users/loginSvc/loginSvc.mock.js', | ||
'src/homeView/homeView.js', | ||
'src/ideas/**/*.js', | ||
'src/navigation/**/*.js', | ||
'src/users/**/*.js', | ||
'src/**/*.spec.js' | ||
], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [ | ||
'src/assets/**/*' | ||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['PhantomJS'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
describe('HomeViewCtrl', function() { | ||
var scope, ctrl; | ||
|
||
beforeEach(module('flintAndSteel')); | ||
|
||
beforeEach(inject(function($rootScope, $controller) { | ||
scope = $rootScope.$new(); | ||
ctrl = $controller('HomeViewCtrl', { $scope: scope }); | ||
})); | ||
|
||
it('should exist', function() { | ||
expect(scope).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
describe('AddIdeaViewCtrl', function() { | ||
var scope, ctrl, $mdToast, $state, ideaSvcMock; | ||
|
||
beforeEach(module('flintAndSteel')); | ||
beforeEach(module('ui.router')); | ||
|
||
beforeEach(inject(function($rootScope, $controller, _$mdToast_, _$state_, _ideaSvcMock_) { | ||
scope = $rootScope.$new(); | ||
$mdToast = _$mdToast_; | ||
$state = _$state_; | ||
ideaSvcMock = _ideaSvcMock_; | ||
|
||
spyOn($state, 'go'); | ||
spyOn(ideaSvcMock, 'postIdea'); | ||
|
||
ctrl = $controller('AddIdeaViewCtrl', { | ||
$scope: scope, | ||
$state: $state, | ||
$mdToast: $mdToast, | ||
ideaSvc: ideaSvcMock | ||
}); | ||
})); | ||
|
||
it('should exist', function() { | ||
expect(ctrl).toBeDefined(); | ||
}); | ||
|
||
it('should add a new idea', function() { | ||
var idea = { | ||
title: 'Test Title', | ||
author: 'Test', | ||
description: 'This is a test idea.', | ||
}; | ||
scope.addNewIdea(idea); | ||
|
||
expect(ideaSvcMock.postIdea).toHaveBeenCalled(); | ||
expect(idea.likes).toBe(0); | ||
expect(idea.comments.length).toBe(0); | ||
expect(idea.backs.length).toBe(0); | ||
}); | ||
}); |
Oops, something went wrong.