Hi,
I would like to know where to start or if it is even possible to test using QUnit an igCombo DOM element (created with MVC Helpers). I would like to test its datasource and some options if are enabled or not.
Any suggestions are highly appreciated,
Kind regards,
Zora
yes, it is definitely possible to test with QUnit. Actually all our internal DEV tests are relying on QUnit.
on your page, you need to add a reference to the QUnit javascript, then you need to add some markup which has the QUnit CSS classes applied - qunit will use those classes to find the elements where it will inject the test results, something like this:
<div style="float:right;width:400px;overflow:auto;">
<h1 id="qunit-header">Test results</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
</div>
then you can start testing :
$(window).load(function () {
QUnit.init();
QUnit.start();
module("igCombo");
test("mycombotest1", function() {
var comboChild = $('#combo1').find('.someClass);
equals(...); // use the QUnit API here
}
Hope it helps. Thanks,
Angel
hey,
Let me know if you need any additional help with this. Thanks,