Page
Example Ng Test
/ Copyright ©2014 by Readify Pty Ltd
9
describe("Landing Page Directive", function() {
var $sut;
describe('If form is started', function() {
var goToDashboardCalled = false;
beforeEach(function() {
module(function($provide) {
$provide.service('utilityService', function() {
return {
goToDashboard: function() {
goToDashboardCalled = true;
}
}
});
});
inject(function($compile, $rootScope, $httpBackend) {
$httpBackend.expectPOST('apiBaseUrlforms/getbasicformdetails').respond(200);
$rootScope.formStarted = true;
var elem = angular.element("
");
$sut = $compile(elem)($rootScope);
$rootScope.$digest();
});
});
it('Redirects to the dashboard.', function() {
expect(goToDashboardCalled).toBe(true);
});
});
});