Title: [195962] trunk/Tools
Revision
195962
Author
[email protected]
Date
2016-02-01 09:02:38 -0800 (Mon, 01 Feb 2016)

Log Message

Improvements to botwatcher's dashboard unit tests.
https://bugs.webkit.org/show_bug.cgi?id=153621

Reviewed by Darin Adler.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js:
(PopoverTracker): Retain a reference to the PopoverTracker so that we can make assertions about it in the unit tests.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js:
(MockTrac): Changing revision 33019 to be on a different branch so that _appendPendingRevisionCount and
_popoverLinesForCommitRange have to traverse commits from different branches.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js: Changing equal to strictEqual
in unit test for _appendPendingRevisionCount. Also added assertions for Popover in test for
_revisionContentWithPopoverForIteration.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js (195961 => 195962)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js	2016-02-01 17:01:56 UTC (rev 195961)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js	2016-02-01 17:02:38 UTC (rev 195962)
@@ -38,6 +38,7 @@
     element.classList.add("popover-tracking");
     element.addEventListener("mouseenter", this._mouseEnteredPopoverOrElement.bind(this), true);
     element.addEventListener("mouseleave", this._mouseExitedPopoverOrElement.bind(this), true);
+    element.popoverTracker = this;
 };
 
 // Only one popover may be active at any time. An active popover is not necessarily visible already.

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js (195961 => 195962)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js	2016-02-01 17:01:56 UTC (rev 195961)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js	2016-02-01 17:02:38 UTC (rev 195962)
@@ -45,7 +45,7 @@
             "date": new Date("2015-11-16T01:18:23.000Z"),
             "description": "description",
             "containsBranchLocation": true,
-            "branchName": "trunk"
+            "branchName": "someOtherBranch"
         },
         {
             "revisionNumber": 33020,

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js (195961 => 195962)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js	2016-02-01 17:01:56 UTC (rev 195961)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js	2016-02-01 17:02:38 UTC (rev 195962)
@@ -76,13 +76,13 @@
 {
     this.view._appendPendingRevisionCount(this.queue);
     var revisionsBehind = this.view.element.getElementsByClassName("message")[0].innerHTML.match(/.*(\d+) revision(|s) behind/)[1];
-    equal(revisionsBehind, "1", "assert revisions behind");
+    strictEqual(revisionsBehind, "1", "assert revisions behind");
 });
 
 test("_popoverLinesForCommitRange", function()
 {
     var lines = this.view._popoverLinesForCommitRange(this.trac, this.trunkBranch, 33018, 33020);
-    strictEqual(lines.length, 3, "has 3 lines");
+    strictEqual(lines.length, 2, "has 2 lines");
 });
 
 test("_presentPopoverForPendingCommits", function()
@@ -106,7 +106,7 @@
     };
     this.view._presentPopoverForRevisionRange(element, popover, context);
     var nodeList = popover._element.getElementsByClassName("pending-commit");
-    strictEqual(nodeList.length, 3, "has 3 commits");
+    strictEqual(nodeList.length, 2, "has 2 commits");
 });
 
 test("_presentPopoverForRevisionRange no commits", function()
@@ -147,6 +147,11 @@
     strictEqual(content.innerHTML, "r33022", "should have correct revision number.");
     strictEqual(content.classList.contains("revision-number"), true, "should have class 'revision-number'.");
     strictEqual(content.classList.contains("popover-tracking"), true, "should have class 'popover-tracking'.");
+    var element = document.createElement("div");
+    var popover = new Dashboard.Popover();
+    this.view._presentPopoverForRevisionRange(element, popover, content.popoverTracker._context);
+    var nodeList = popover._element.getElementsByClassName("pending-commit");
+    strictEqual(nodeList.length, 2, "has 2 commits");
 });
 
 module("BuildBotQueue", {

Modified: trunk/Tools/ChangeLog (195961 => 195962)


--- trunk/Tools/ChangeLog	2016-02-01 17:01:56 UTC (rev 195961)
+++ trunk/Tools/ChangeLog	2016-02-01 17:02:38 UTC (rev 195962)
@@ -1,5 +1,21 @@
 2016-02-01  Jason Marcell  <[email protected]>
 
+        Improvements to botwatcher's dashboard unit tests.
+        https://bugs.webkit.org/show_bug.cgi?id=153621
+
+        Reviewed by Darin Adler.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/PopoverTracker.js:
+        (PopoverTracker): Retain a reference to the PopoverTracker so that we can make assertions about it in the unit tests.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js:
+        (MockTrac): Changing revision 33019 to be on a different branch so that _appendPendingRevisionCount and
+        _popoverLinesForCommitRange have to traverse commits from different branches.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js: Changing equal to strictEqual
+        in unit test for _appendPendingRevisionCount. Also added assertions for Popover in test for
+        _revisionContentWithPopoverForIteration.
+
+2016-02-01  Jason Marcell  <[email protected]>
+
         Refactor to add event listeners and start periodic updates for all trac instances.
         https://bugs.webkit.org/show_bug.cgi?id=153609
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to