Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure I can solve this without some more info, but I can point out some possible issues. </p> <p>The first test seems to have invalid syntax on line 2</p> <pre><code>var panelId = '#PanelMyTab'); </code></pre> <p>But that's probably a type mistake, seeing as you say the first always passes.</p> <p>I'm assuming that for the first test to pass(and be valid) the loadTab(event,ui) must run the jQuery.fn.on(), without it no assertions have been run. Which doing some testing with jQuery UI Tabs, seems to be the case (just not sure if it was your intention).</p> <p>I'm not sure it's advisable putting these assertions within that function, and you must understand that you have overwritten the jquery function with a function that doesn't do anything, so it's likely to cause issues.</p> <p>You seem to be doing something similar in the second test, you are expecting 5 assertions, but I can only see how the final 3 can be run</p> <pre><code>ok(/notest$/.test($(form).prop('action')), 'Making sure action is not replaced'); equal($(form).prop('target'), '', 'Making sure that target is not replaced'); ok(false === result, 'click event returns false to not refresh page'); </code></pre> <p>The other 2 are within a submit function that doesn't look like it is invoked as part of the test.</p> <p>Remember these tests are synchronous so it won't wait for you to hit submit before running the test and failing.</p> <p>Here is an example</p> <pre><code>test('asynchronous test', function() { setTimeout(function() { ok(true); }, 100) }) </code></pre> <p>Would fail as the ok is run 100ms after the test.</p> <pre><code>test('asynchronous test', function() { // Pause the test first stop(); setTimeout(function() { ok(true); // After the assertion has been called, // continue the test start(); }, 100) }) </code></pre> <p>The stop() tells qunit to wait and the start() to go!</p> <p>There is also a asyncTest() detailed in the api <a href="http://api.qunitjs.com/asyncTest/" rel="nofollow">here</a></p> <p>Finally, it seems like you are trying to debug your code with these tests. It would be much easier to use chrome developer tools or firebug in firefox to set breakpoints on your code, and use console.log() and console.dir() to output information.</p> <p>That being said I have no idea how it works for you at all, so I could be missing something :) If you're still stuck, see if you can add some more of the surrounding code and what your trying to achieve. Hope this helps.</p> <p>PS: there is also a <code>};</code> at the end which is invalid in the code you have given us, probably relevant in the actual application though ;)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload