webogram-i2p/test/unit/AppImPanelControllerSpec.js
Bart 03bc92006d Added tests for AppImPanelController, DocumentModalController, EmbedModalController and VideoModalController (#1362)
* Added test for AppImPanelControllerSpec, cleaned up style of all tests

All tests give 0 errors when running gulp standard
All credits for those test still go to @Ryuno-Ki, I did not functionaly change the testing code

* add Test for DocumentModalController

* added tests for the EmbedModalController and VideoModalController
2017-04-03 17:01:53 +03:00

22 lines
586 B
JavaScript

/* global describe, it, inject, expect, beforeEach, jasmine */
describe('AppImPanelController', function () {
var $scope
beforeEach(module('myApp.controllers'))
beforeEach(function () {
inject(function (_$controller_, _$rootScope_) {
$scope = _$rootScope_.$new()
$scope.$on = jasmine.createSpy('$on')
_$controller_('AppImPanelController', { $scope: $scope })
})
})
// define tests
it('sets $on(user_update) to no-operation function', function (done) {
expect($scope.$on).toHaveBeenCalledWith('user_update', angular.noop)
done()
})
})