Ciao a tutti,
volevo proporvi questo piccolo dilemma in cui mi sono trovato.
Io ho la seguente funzione nel mio main.js
codice:
function updateProgressBar (val){
    $('.player-scrub').slider({
        value: val
    });
    //console.log(val);
}
ora nel mio file test.js ho questo codice:
codice:
test('Test updateProgressbar function', function(){

    testBar(23, 23);//pass
    testBar(80, 80);//pass
    testBar(74, 75);//should fail


    function testBar (then, expect) {
        updateProgressBar(then);
        equal($('.player-scrub').slider('value'), expect, "The progressBar works properly");
    }
});
il problema č che non ricnonsce l'elemento $('.player-scrub') percheč si trova nella pagina index.html che non ho importato nella mia pagina test.html.
Quindi ho provato ad importarla ma ottengo questo errore:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Comunque quello che vorrei capire eč quindi come testo il cambiamento degli elementi del DOM?
E' giusto importare l'intera pagina HTML?
QUnit serve per testare funzioni javascript dove ritorniamo sempre un valore di ritorno?
Grazie ragazzi e scusate se sono stato un pņ confusionario