-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start testing with Karma and Jasmine + Several changes
- Loading branch information
Showing
17 changed files
with
202 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
WebApps 3: Project | ||
= | ||
|
||
Drawing webapplication | ||
Drawing Web Application | ||
- | ||
|
||
This Application was developed for my college class "WebApps III". | ||
|
||
Features: | ||
- | ||
* Draw together with others | ||
* Save your drawings | ||
* Authentication (& sessions) | ||
* Custom colors | ||
* Custom brush size | ||
* Clear the Canvas | ||
* Home Page showing several saved drawings | ||
* More to come... | ||
|
||
|
||
##### By: | ||
Thomas Buys, 3D |
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,51 @@ | ||
describe("Canvas Controller Test", () => { | ||
describe("When I call canvas.init", () => { | ||
|
||
beforeEach(angular.mock.module('app')); | ||
|
||
let scope; | ||
let vm; | ||
|
||
beforeEach(inject(($controller, _$rootScope_) => { | ||
scope = _$rootScope_.$new(); | ||
vm = $controller('CanvasCtrl', { $scope: scope }); | ||
})); | ||
|
||
it('sets the brush size to 5', () => { | ||
const size = 5; | ||
expect(vm.App.ctx.lineWidth).toEqual(size); | ||
expect(vm.ownBrushSize).toEqual(size); | ||
}); | ||
|
||
it('sets the fillStyle to solid', () => { | ||
const lineCap = "round"; | ||
expect(vm.App.ctx.lineCap).toEqual(lineCap); | ||
}); | ||
|
||
it('changes brush size correctly when method is called', () => { | ||
const initialSize = 5; | ||
const newSize = 85; | ||
expect(vm.App.ctx.lineWidth).toEqual(initialSize); | ||
expect(vm.ownBrushSize).toEqual(initialSize); | ||
vm.App.changeBrushSize(85); | ||
expect(vm.App.ctx.lineWidth).toEqual(newSize); | ||
expect(vm.ownBrushSize).toEqual(newSize); | ||
}); | ||
|
||
it('sets the alert boolean to false initially', () => { | ||
const bool = false; | ||
expect(scope.showAlert).toEqual(bool); | ||
}); | ||
|
||
it('changes brush color correctly when method is called', () => { | ||
const initialColor = "#000000"; | ||
const newColor = "#111111"; | ||
expect(vm.App.ctx.strokeStyle).toEqual(initialColor); | ||
expect(vm.ownColor).toEqual(initialColor); | ||
scope.submitCustomColor("#111111"); | ||
expect(vm.App.ctx.strokeStyle).toEqual(newColor); | ||
expect(vm.ownColor).toEqual(newColor); | ||
}); | ||
|
||
}); | ||
}); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,94 @@ | ||
// Karma configuration | ||
// Generated on Tue Dec 06 2016 21:41:03 GMT+0100 (Romance Standard Time) | ||
|
||
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: [ | ||
'https://code.jquery.com/jquery-3.1.1.js', | ||
'node_modules/angular/angular.js', | ||
'node_modules/angular-mocks/angular-mocks.js', | ||
'node_modules/angular-ui-router/release/angular-ui-router.js', | ||
'node_modules/angular-material/angular-material.js', | ||
'node_modules/angular-animate/angular-animate.js', | ||
'node_modules/angular-aria/angular-aria.js', | ||
'http://localhost:9876/socket.io/socket.io.js', | ||
'client/app/app.js', | ||
{ pattern: 'test-context.js', watched: false } | ||
], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [ | ||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
'client/app/app.js': ['webpack'], | ||
'test-context.js': ['webpack'] | ||
}, | ||
webpack: { | ||
module: { | ||
loaders: [ | ||
{ test: /\.js/, exclude: /node_modules/, loader: 'babel-loader' } | ||
] | ||
}, | ||
node: { | ||
fs: 'empty' | ||
}, | ||
watch: true | ||
}, | ||
webpackServer: { | ||
noInfo: true | ||
}, | ||
|
||
|
||
// 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: true, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['Chrome'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}) | ||
} |
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
Oops, something went wrong.