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

202
Views
TypeError: popupAjax is not a function in Jasmine test

i am doing a test on a js function, and when jasmine enters the function, it returns this:

TypeError: popupAjax is not a function
    at buscarAuditoria (file:///C:/Dev/Entorno_Desarrollo/Git/IBERGAUDI/java/sigaudit/WebContent/js/sigaudit/hallazgos/detalleHallazgos.js:358:3)
    at UserContext.<anonymous> (file:///C:/Dev/Entorno_Desarrollo/Git/IBERGAUDI/java/sigaudit/WebContent/js/jasmine/spec/detalleHallazgosSpec.js:25:28)
    at <Jasmine>

This is the code on my Spec file:

it("prueba para buscar auditoria", function () {
        var fakeElement = jasmine.createSpy();
        fakeElement.fakeMethod = buscarAuditoria();
        spyOn(fakeElement, "fakeMethod");
        
        expect(fakeElement.fakeMethod()).toHaveBeenCalled()
    });

And this is the function i am trying to test in js:

function buscarAuditoria() {
    if ("" !== hallazgoDto.auditoria.idRegistro && null !== hallazgoDto.auditoria.idRegistro) {
        var datos = {};
        datos.idAuditoria   = hallazgoDto.auditoria.idRegistro;
        popupAjax({
            selectorPopup   : '#popupAuditoria',
            urlPopup        : $context + '/auditoria/cargaInicialPopup.action',
            dataPopup       : datos,
            title           : $i18n['i18n.auditorias.excel.detalleAuditoria'],
            resize          : false,
            width           : '60%',
            mostrarAceptar  : false
        });
    }
}

Any help will be apreciated, because i am new with jasmine, thanks in advance.

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!