Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

649
Views
How to test callback function on a popup using Karma / Jasmine?

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);
        }
    });
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!