Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Add Rerun link to placeholders. Fixes #240
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 5 May 2012 10:44:44 +0000 (12:44 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sat, 5 May 2012 10:44:44 +0000 (12:44 +0200)
qunit/qunit.js

index c98aec0..f535807 100644 (file)
@@ -40,15 +40,21 @@ function Test( name, testName, expected, async, callback ) {
 
 Test.prototype = {
        init: function() {
-               var b, li,
+               var a, b, li,
         tests = id( "qunit-tests" );
 
                if ( tests ) {
                        b = document.createElement( "strong" );
-                       b.innerHTML = "Running " + this.name;
+                       b.innerHTML = this.name;
+
+                       // `a` initialized at top of scope
+                       a = document.createElement( "a" );
+                       a.innerHTML = "Rerun";
+                       a.href = QUnit.url({ filter: getText([b]).replace( /\([^)]+\)$/, "" ).replace( /(^\s*|\s*$)/g, "" ) });
 
                        li = document.createElement( "li" );
                        li.appendChild( b );
+                       li.appendChild( a );
                        li.className = "running";
                        li.id = this.id = "qunit-test-output" + testId++;
 
@@ -203,11 +209,6 @@ Test.prototype = {
                        b = document.createElement( "strong" );
                        b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
 
-                       // `a` initialized at top of scope
-                       a = document.createElement( "a" );
-                       a.innerHTML = "Rerun";
-                       a.href = QUnit.url({ filter: getText([b]).replace( /\([^)]+\)$/, "" ).replace( /(^\s*|\s*$)/g, "" ) });
-
                        addEvent(b, "click", function() {
                                var next = b.nextSibling.nextSibling,
                                        display = next.style.display;
@@ -230,8 +231,9 @@ Test.prototype = {
                        li = id( this.id );
                        li.className = bad ? "fail" : "pass";
                        li.removeChild( li.firstChild );
+                       a = li.firstChild;
                        li.appendChild( b );
-                       li.appendChild( a );
+                       li.appendChild ( a );
                        li.appendChild( ol );
 
                } else {

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf