Hey Ionites,
I have a popup in my controller
$ionicPopup.alert({
title : $translate.instant('miscelleanous.congratulation')
})
.then(function() {
// Lot of thing come here
});
In my unit Test (Karma + Jasmine), I don’t know how to enter in the ‘then’ function of my popup
describe('When registration failed', function() {
var vm;
beforeEach(function() {
vm = createController();
});
it('Should display error message', function() {
var popup = spyOn($ionicPopup, 'alert').and.callThrough();
expect(popup).toHaveBeenCalled();
});
});
So Ok my popup is correctly call but I don’t know how to test the promise that return the popup ?