Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda