export class Helperservice{
showDialog(data: any): void {
$(document).trigger('openDialog', data);
}
hideDialog(): void {
$(document).trigger('closeDialog');
}
}
//Usage
helper.showDialog({
name: 'termsandcondition',
data: {
title:'title',
message:'Message',
callback: () => {
helper.hideDialog();
}
}
});
how to write unit testing above given code using jasmine karma helper service have two method i will call helper.dialog method with parameter passing that params have json type and also have callback function inside another function called helper.hideDialog.
i am writing unit testing for helper.showDialog but i cant achieve inside of callback in helper.hideDialog function if any person know kindly post your suggestion