I'm using ngDialog v0.6.2 to display some info and get some actions from users, and I make a call to ngDialog from my controller, and I would like to test this scenario.
I'm making a call to my service, and based on the status code of the response I call this code above.
However, I would like to make this interaction without using protractor at least so far, and I want to be able to get the confirm() function from Jasmine for coverage reasons.
My Spec:
it('Deve conflitar na criaçao de um cartão', inject(function(CartaoConsumoService, $timeout, $compile, $document) {
spy(ngDialog, 'openConfirm').and.callThrough();
httpBackend.whenGET('modalOverrideCardId').respond(200);
httpBackend.whenPOST(API_URL.cartoesConsumoUrl).respond(409);
controller.createCard(obj);
httpBackend.flush();
ngDialog.openConfirm('modalOverrideCardId');
// Here is where i'm stuck
}));
I'm using ngDialog v0.6.2 to display some info and get some actions from users, and I make a call to ngDialog from my controller, and I would like to test this scenario.
In my Controller I have this:
I'm making a call to my service, and based on the status code of the response I call this code above.
However, I would like to make this interaction without using protractor at least so far, and I want to be able to get the
confirm()
function from Jasmine for coverage reasons.My Spec: