Skip to main content

Bug Tracker

Side navigation

#3361 closed bug (fixed)

Opened September 12, 2008 12:21AM UTC

Closed June 10, 2009 09:41AM UTC

qunit: Changes to not require pre-existing DOM elements

Reported by: sugendran Owned by: joern
Priority: minor Milestone: 1.3
Component: qunit Version: 1.2.6
Keywords: qunit Cc:
Blocked by: Blocking:
Description

I don't think qunit should require DOM elements to pre-exisiting (i.e. changes to a site's actual HTML should not have to happen in order to test the functionality)

--- my changes to the runTest() function ---

function runTest() {

_config.blocking = false;

var started = +new Date;

_config.fixture = (document.getElementById('main') ? document.getElementById('main').innerHTML : "");

_config.ajaxSettings = jQuery.ajaxSettings;

if(!document.getElementById("tests")){

$("body").append('<div id="tests"></div>');

}

synchronize(function() {

jQuery('<p id="testresult" class="result">').html(['Tests completed in ',

+new Date - started, ' milliseconds.<br/>',

'<span class="bad">', _config.stats.bad, '</span> tests of <span class="all">', _config.stats.all, '</span> failed.</p>']

.join(''))

.appendTo("body");

jQuery("#banner").addClass(_config.stats.bad ? "fail" : "pass");

});

}

Attachments (0)
Change History (1)

Changed June 10, 2009 09:41AM UTC by joern comment:1

resolution: → fixed
status: newclosed

QUnit now requires only the fixture element #main to be present, everything else is generated.