Skip to content

Instantly share code, notes, and snippets.

@sayak-sarkar
Created July 3, 2014 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayak-sarkar/ae7359f536518fd9e3cf to your computer and use it in GitHub Desktop.
Save sayak-sarkar/ae7359f536518fd9e3cf to your computer and use it in GitHub Desktop.
Alternate issue.
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.sidebar = 'show-sidebar' || 'hide-sidebar';
$scope.sidebarEnabled = true || false;
});
});
});
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