diff options
Diffstat (limited to 'reporting/pages/test/spec')
-rw-r--r-- | reporting/pages/test/spec/controllers/main.js | 23 | ||||
-rw-r--r-- | reporting/pages/test/spec/directives/mydirective.js | 20 |
2 files changed, 43 insertions, 0 deletions
diff --git a/reporting/pages/test/spec/controllers/main.js b/reporting/pages/test/spec/controllers/main.js new file mode 100644 index 0000000..b92366d --- /dev/null +++ b/reporting/pages/test/spec/controllers/main.js @@ -0,0 +1,23 @@ +'use strict'; + +describe('Controller: MainCtrl', function () { + + // load the controller's module + beforeEach(module('opnfvApp')); + + var MainCtrl, + scope; + + // Initialize the controller and a mock scope + beforeEach(inject(function ($controller, $rootScope) { + scope = $rootScope.$new(); + MainCtrl = $controller('MainCtrl', { + $scope: scope + // place here mocked dependencies + }); + })); + + it('should attach a list of awesomeThings to the scope', function () { + expect(MainCtrl.awesomeThings.length).toBe(3); + }); +}); diff --git a/reporting/pages/test/spec/directives/mydirective.js b/reporting/pages/test/spec/directives/mydirective.js new file mode 100644 index 0000000..598c9de --- /dev/null +++ b/reporting/pages/test/spec/directives/mydirective.js @@ -0,0 +1,20 @@ +'use strict'; + +describe('Directive: myDirective', function () { + + // load the directive's module + beforeEach(module('opnfvApp')); + + var element, + scope; + + beforeEach(inject(function ($rootScope) { + scope = $rootScope.$new(); + })); + + it('should make hidden element visible', inject(function ($compile) { + element = angular.element('<my-directive></my-directive>'); + element = $compile(element)(scope); + expect(element.text()).toBe('this is the myDirective directive'); + })); +}); |