Last active
August 29, 2015 14:03
-
-
Save sayak-sarkar/4558cf735e149b66f222 to your computer and use it in GitHub Desktop.
Reporting App DefaultCtrl Tst
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
describe("Unit: Testing Reporting App Controllers", function() { | |
beforeEach(angular.mock.module('reportingapp')) | |
window.CONFIG = {"root":"http://safetyapps-api-staging.mychanger.net","api":"http://safetyapps-api-staging.mychanger.net/api/","statics":"//s3-eu-west-1.amazonaws.com/safetyapps-assets/reportingapp/0.0.1/","organization":"changer","token":"e66d390004436e34863fe724b5df8fced4cf6142c8715f99","refreshToken":"6c325209563ec2259063b824360db3d929b5b3be8173e9bd"}; | |
beforeEach(angular.mock.inject(function ($controller, $rootScope, $state, $http) { | |
scope = $rootScope.$new(); | |
defaultCtrl = $controller('DefaultCtrl', { | |
$scope: scope, | |
$state: $state, | |
$http: $http | |
}); | |
headerCtrl = $controller('HeaderCtrl', { | |
$scope: scope, | |
$state: $state | |
}); | |
sidebarCtrl = $controller('SidebarCtrl', { | |
$scope: scope, | |
$state: $state | |
}) | |
})); | |
it('should have a DefaultCtrl controller', function() { | |
expect(defaultCtrl).not.to.equal(null); | |
describe('.toggleSidebar()', function () { | |
it('should be able to update the sidebar data', function () { | |
scope.toggleSidebar(); | |
expect(scope.sidebar).to.equal('show-sidebar' || 'hide-sidebar'); | |
}); | |
}); | |
}); | |
it('should have a HeaderCtrl controller', function() { | |
expect(headerCtrl).not.to.equal(null); | |
}); | |
it('should have a SidebarCtrl controller', function() { | |
expect(sidebarCtrl).not.to.equal(null); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment