Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda