Hi guys, i was wondering if any of you know a good way to unit test ionicActionSheet. Here is a simple action sheet and the main thing i want to test is the click functions associated with each buttons, if any of you have some idea of how i can access the functions that would be great. And by the way i’m using Karma + Jasmine for testing
var hideSheet = $ionicActionSheet.show({
buttons: [
{
text: translate('TEST-2'),
click: function() {
SomeService.functionCall;
$state.go('app.something-1');
}
},
{
text: translate('EDIT'),
click: function() {
$state.go('app.something-2');
}
}
],
destructiveText: translate('TEST-1'),
titleText: title,
cancelText: translate('LOG_CANCEL'),
cancel: function() {
},
buttonClicked: function(index, button) {
button.click();
return true;
},
destructiveButtonClicked: function(){
$scope.example();
return true;
}
});