Bug 1499378 - Fix mocha test; r=bgrins.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 16 Oct 2018 15:02:17 +0000
changeset 499940 88f1a7ca5c3f31a5b5d53fc5231328965f9df4a0
parent 499939 a3521c2b925b7ab1847031a027730962179eea9e
child 499941 83aba42445aad36c01279a71fc4c73563991a3be
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1499378
milestone64.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 1499378 - Fix mocha test; r=bgrins. A function was missing in the serviceContainer stub, and the console.trace with params test needed a Provider wrapper to work with the latest changes made to the ObjectInspector. Differential Revision: https://phabricator.services.mozilla.com/D8861
devtools/client/webconsole/test/components/console-api-call.test.js
devtools/client/webconsole/test/fixtures/serviceContainer.js
--- a/devtools/client/webconsole/test/components/console-api-call.test.js
+++ b/devtools/client/webconsole/test/components/console-api-call.test.js
@@ -322,17 +322,20 @@ describe("ConsoleAPICall component:", ()
         .toBe(filepath);
 
       // it should not be collapsible.
       expect(wrapper.find(`.theme-twisty`).length).toBe(0);
     });
     it("render with arguments", () => {
       const message = stubPreparedMessages.get(
         "console.trace('bar', {'foo': 'bar'}, [1,2,3])");
-      const wrapper = render(ConsoleApiCall({ message, serviceContainer, open: true }));
+      // We need to wrap the ConsoleApiElement in a Provider in order for the
+      // ObjectInspector to work.
+      const wrapper = render(Provider({ store: setupStore() },
+        ConsoleApiCall({ message, serviceContainer, open: true })));
 
       const filepath = "http://example.com/browser/devtools/client/webconsole/" +
                        "test/fixtures/stub-generators/test-console-api.html";
 
       expect(wrapper.find(".message-body").text())
         .toBe("console.trace() bar Object { foo: \"bar\" } Array(3) [ 1, 2, 3 ]");
 
       const frameLinks = wrapper.find(
--- a/devtools/client/webconsole/test/fixtures/serviceContainer.js
+++ b/devtools/client/webconsole/test/fixtures/serviceContainer.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 module.exports = {
   attachRefToHud: () => {},
+  canRewind: () => false,
   emitNewMessage: () => {},
   hudProxy: {
     client: {},
     releaseActor: actor => console.log("Release actor", actor),
   },
   onViewSourceInDebugger: () => {},
   onViewSourceInStyleEditor: () => {},
   onViewSourceInScratchpad: () => {},