diff --git a/resources/static/pages/page_helpers.js b/resources/static/pages/page_helpers.js index b15cf2eb8002c985150dd4f92af6e76628756511..375584079fd592cc22019a2d72ca6ec8602f5dac 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 77293232e367abaa16bd8f355f2f97a2453a4b90..5df6b052f6f8d79a3539b7d453da436bdc361824 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); + }); });