Bug 1053774: fix test failures. rs=bustage,Standard8
authorMike de Boer <mdeboer@mozilla.com>
Thu, 18 Sep 2014 11:28:43 +0200
changeset 206044 dae5e0f456d2b072a7801bfd139a1af9c35595fd
parent 206043 849a1b3074c3f8849f2578c9872dfe1ea14d81f7
child 206045 a78ec4ea3f52094492143e80fcbfe8538ca05f08
push id49338
push userkwierso@gmail.com
push dateThu, 18 Sep 2014 23:10:09 +0000
treeherdermozilla-inbound@245051c6a7ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage, Standard8
bugs1053774
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053774: fix test failures. rs=bustage,Standard8
browser/components/loop/test/desktop-local/panel_test.js
--- a/browser/components/loop/test/desktop-local/panel_test.js
+++ b/browser/components/loop/test/desktop-local/panel_test.js
@@ -39,17 +39,18 @@ describe("loop.panel", function() {
         return JSON.stringify({textContent: "fakeText"});
       },
       get locale() {
         return "en-US";
       },
       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);
   });
 
   afterEach(function() {
     delete navigator.mozLoop;
     sandbox.restore();
@@ -338,26 +339,25 @@ describe("loop.panel", function() {
       });
 
       it("should reset all pending notifications", function() {
         sinon.assert.calledOnce(view.props.notifications.reset);
       });
 
       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
         }));
         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() {
         fakeClient.requestCallUrl = sandbox.stub();
         var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
           notifications: notifications,
           client: fakeClient
         }));
@@ -403,17 +403,16 @@ describe("loop.panel", function() {
           }));
           view.setState({
             pending: false,
             copied: false,
             callUrl: "http://example.com",
             callUrlExpiry: 6000
           });
 
-          view.getDOMNode().querySelector(".btn-email").dataset.mailto = "#";
           TestUtils.Simulate.click(view.getDOMNode().querySelector(".btn-email"));
 
           sinon.assert.calledOnce(navigator.mozLoop.noteCallUrlExpiry);
           sinon.assert.calledWithExactly(navigator.mozLoop.noteCallUrlExpiry,
             6000);
         });
 
       it("should note the call url expiry when the url is copied manually",