Bug 1053774: fix test failures. rs=bustage,Standard8

This commit is contained in:
Mike de Boer
2014-09-18 11:28:43 +02:00
parent 0039a9e981
commit 23a151e286

View File

@@ -44,7 +44,8 @@ describe("loop.panel", function() {
setLoopCharPref: sandbox.stub(),
getLoopCharPref: sandbox.stub().returns("unseen"),
copyString: sandbox.stub(),
noteCallUrlExpiry: sinon.spy()
noteCallUrlExpiry: sinon.spy(),
composeEmail: sinon.spy()
};
document.mozL10n.initialize(navigator.mozLoop);
@@ -343,7 +344,6 @@ describe("loop.panel", function() {
it("should display a share button for email", function() {
fakeClient.requestCallUrl = sandbox.stub();
var mailto = 'mailto:?subject=email-subject&body=http://example.com';
var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
notifications: notifications,
client: fakeClient
@@ -351,8 +351,8 @@ describe("loop.panel", function() {
view.setState({pending: false, callUrl: "http://example.com"});
TestUtils.findRenderedDOMComponentWithClass(view, "btn-email");
expect(view.getDOMNode().querySelector(".btn-email").dataset.mailto)
.to.equal(encodeURI(mailto));
TestUtils.Simulate.click(view.getDOMNode().querySelector(".btn-email"));
sinon.assert.calledOnce(navigator.mozLoop.composeEmail);
});
it("should feature a copy button capable of copying the call url when clicked", function() {
@@ -408,7 +408,6 @@ describe("loop.panel", function() {
callUrlExpiry: 6000
});
view.getDOMNode().querySelector(".btn-email").dataset.mailto = "#";
TestUtils.Simulate.click(view.getDOMNode().querySelector(".btn-email"));
sinon.assert.calledOnce(navigator.mozLoop.noteCallUrlExpiry);