Skip to content
Snippets Groups Projects
Commit 14e6da82 authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

Fix the failing unit test in add_email_address.

* When setting the text of the email address, use dom.setInner.
* Update the test to use .val() for the check.

close #657
parent 5291d203
No related branches found
No related tags found
No related merge requests found
......@@ -37,13 +37,15 @@
(function() {
"use strict";
var ANIMATION_TIME=250;
var ANIMATION_TIME=250,
dom = BrowserID.DOM;
function emailRegistrationSuccess(info) {
$("#email").text(info.email);
dom.setInner("#email", info.email);
if (info.origin) {
$(".website").html(info.origin);
dom.setInner(".website", info.origin);
$(".siteinfo").show();
}
......
......@@ -50,6 +50,7 @@
$(".error").removeClass("error");
$("#error").stop().hide();
$(".website").text("");
$(".siteinfo").hide();
},
teardown: function() {
network.setXHR($);
......@@ -65,7 +66,7 @@
bid.addEmailAddress("token");
setTimeout(function() {
equal($("#email").text(), "testuser@testuser.com", "email set");
equal($("#email").val(), "testuser@testuser.com", "email set");
ok($(".siteinfo").is(":visible"), "siteinfo is visible when we say what it is");
equal($(".website").text(), "browserid.org", "origin is updated");
start();
......@@ -76,7 +77,7 @@
bid.addEmailAddress("token");
setTimeout(function() {
equal($("#email").text(), "testuser@testuser.com", "email set");
equal($("#email").val(), "testuser@testuser.com", "email set");
equal($(".siteinfo").is(":visible"), false, "siteinfo is not visible without having it");
equal($(".siteinfo .website").text(), "", "origin is not updated");
start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment