I'm trying to test this piece of code, however I only get coverage up to onConfirm: () =>
and can't find a way to trigger the callback, so it gets to the next line of code. Does anybody have any suggestions on how to proceed with this?
deleteUser(Id) {
const storage = new Storage();
const { username } = Storage.getById(Id);
Message.showConfirm({
content: Id === User.getId() ? translate('confirm') : translate('delete',),
onConfirm: () => {
Storage.deleteMember(Id);
const rowElement = this.container.querySelector(`tr[data-user-id="${Id}"]`);
DOMHelper.removeElement(rowElement);
}
});
}