You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have used the createDialog service of fundoo solutions to show the pop up modal.I want to test the my delete functionality using jasmine.How to do that? please help.
Here is my code:
$scope.deleteProject = function (id) {
Hi,
I have used the createDialog service of fundoo solutions to show the pop up modal.I want to test the my delete functionality using jasmine.How to do that? please help.
Here is my code:
$scope.deleteProject = function (id) {
createDialog('/App/Modules/ReadAdmin/Projects/Templates/deleteproject.html', {
id: 'DeleteProjectDialog',
title: 'Delete Project',
backdrop: true,
controller: 'DetailCtrl',
success: { label: 'Proceed', fn: function () { projectService.delete({ id: id }); } },
cancel: { label: 'Cancel', fn: function () { console.log("Delete modal closed"); } }
},
{
id: id
});
};
//Details controller
projectApp.controller('DetailCtrl', function ($scope, projectService, id) {
$scope.project = projectService.get({ id: id });
});
//This is my test
it('should delete the project', function () {
$httpBackend.expectGET(api/projects).respond([{ id: 100, code: "B100", "name": "ABC"}]);
$httpBackend.expectDELETE(api/projects/100').respond({});
var ctrl = $controller('DetailCtrl', { $scope: $scope, projectService: mockprojectService,createDialog:dialogService });
$scope.deleteProject(100);
$httpBackend.flush();
expect(mockprojectService.delete).toHaveBeenCalled();
});
The text was updated successfully, but these errors were encountered: