From 0b08007da1d80dd822df7bd7c35d1d5674453323 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Fri, 17 Feb 2012 10:57:34 +0000
Subject: [PATCH] Fix the extended error info not opening.

* Add BrowserID.ErrorDisplay.start() to showFailure - this handles opening the extended info.
* Add a test to make sure clicking on the openMoreInfo button shows the extended info.

close #1139
---
 resources/static/pages/page_helpers.js         |  1 +
 .../static/test/cases/pages/page_helpers.js    | 18 +++++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/resources/static/pages/page_helpers.js b/resources/static/pages/page_helpers.js
index b15cf2eb8..375584079 100644
--- a/resources/static/pages/page_helpers.js
+++ b/resources/static/pages/page_helpers.js
@@ -63,6 +63,7 @@ BrowserID.PageHelpers = (function() {
   function showFailure(error, info, callback) {
     info = $.extend(info || {}, { action: error, dialog: false });
     bid.Screens.error.show("error", info);
+    errorDisplay.start();
     callback && callback(false);
   }
 
diff --git a/resources/static/test/cases/pages/page_helpers.js b/resources/static/test/cases/pages/page_helpers.js
index 77293232e..5df6b052f 100644
--- a/resources/static/test/cases/pages/page_helpers.js
+++ b/resources/static/test/cases/pages/page_helpers.js
@@ -147,10 +147,22 @@
     });
   });
 
-  asyncTest("showFailure shows a failure screen", function() {
-    pageHelpers.showFailure({}, errors.offline, function() {
+  asyncTest("showFailure - show a failure screen, extended info can be opened", function() {
+    pageHelpers.showFailure("error", { network: 400, status: "error"}, function() {
       testHelpers.testErrorVisible();
-      start();
+
+      // We have to make sure the error screen itself is visible and that the
+      // extra info is hidden so when we click on the extra info it opens.
+      $("#error").show();
+      $("#moreInfo").hide();
+      $("#openMoreInfo").trigger("click");
+
+      // Add a bit of delay to wait for the animation
+      setTimeout(function() {
+        equal($("#moreInfo").is(":visible"), true, "extra info is visible after click");
+        start();
+      }, 100);
+
     });
   });
 
-- 
GitLab