Our team has recently taken on the task of writing test cases for our application, specifically focusing on controllers. Utilizing Mocha, Chai, and Sinon libraries, we are looking for guidance on how to effectively write these test cases.
We have shared a plunker link that contains the code for our controller. Can anyone provide assistance in creating test cases for this controller? Our ultimate goal is to implement these test cases for other controllers based on the initial push with this one.
http://plnkr.co/edit/oginuqO0afxnWbVMos0f?p=info
Below is the code snippet:
angular.module('ngBoilerplate.account', [
'ui.router', 'ngAnimate', 'ui.bootstrap', 'ngBoilerplate.contact', 'ngResource', 'jcs-autoValidate', 'ngCookies', 'ngTagsInput'
])
.controller('addAccount', function($scope, industryService, $http, $state, LoggedUser) {
// Controller logic here
})
.factory("loggedInUser", function($resource) {
return $resource("/rest/users/:username");
})
.factory("industryService", function($resource) {
return $resource("/rest/accounts/industry");
})
Any assistance provided would be greatly appreciated.
Thank you in advance. Please feel free to reach out if you have any questions or require further information.