Bug 1533276 - Fix mocha tests; r=Honza.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Fri, 08 Mar 2019 11:51:08 +0000
changeset 521170 0f38d240b02435b94afadd7829946d07cd0d6fe6
parent 521169 ea20a62a2fa073eb77f1f03ad5a3987191d8626b
child 521171 398dfc746ccd2f079d74198274020691b6299968
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1533276
milestone67.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 1533276 - Fix mocha tests; r=Honza. Differential Revision: https://phabricator.services.mozilla.com/D22457
devtools/client/webconsole/test/components/console-api-call.test.js
devtools/client/webconsole/test/components/filter-bar.test.js
devtools/client/webconsole/test/components/webconsole-wrapper.test.js
devtools/client/webconsole/types.js
--- a/devtools/client/webconsole/test/components/console-api-call.test.js
+++ b/devtools/client/webconsole/test/components/console-api-call.test.js
@@ -277,17 +277,18 @@ describe("ConsoleAPICall component:", ()
   });
 
   describe("console.timeEnd", () => {
     it("renders as expected", () => {
       const message = stubPreparedMessages.get("console.timeEnd('bar')");
       const wrapper = render(ConsoleApiCall({ message, serviceContainer }));
 
       expect(wrapper.find(".message-body").text()).toBe(message.messageText);
-      expect(wrapper.find(".message-body").text()).toMatch(/^bar: \d+(\.\d+)?ms$/);
+      expect(wrapper.find(".message-body").text())
+        .toMatch(/^bar: \d+(\.\d+)?ms - timer ended$/);
     });
     it("shows an error if the timer doesn't exist", () => {
       const message = stubPreparedMessages.get("timeEnd.timerDoesntExist");
       const wrapper = render(ConsoleApiCall({ message, serviceContainer }));
 
       expect(wrapper.find(".message-body").text()).toBe("Timer “bar” doesn’t exist.");
     });
   });
--- a/devtools/client/webconsole/test/components/filter-bar.test.js
+++ b/devtools/client/webconsole/test/components/filter-bar.test.js
@@ -48,22 +48,31 @@ describe("FilterBar component:", () => {
     const clearButton = toolbar.children().eq(0);
     expect(clearButton.attr("class")).toBe("devtools-button devtools-clear-icon");
     expect(clearButton.attr("title")).toBe("Clear the Web Console output");
 
     // Separator
     expect(toolbar.children().eq(1).attr("class")).toBe("devtools-separator");
 
     // Text filter
-    const textFilter = toolbar.children().eq(2);
+    const textInput = toolbar.children().eq(2);
+    expect(textInput.attr("class")).toBe("devtools-searchbox has-clear-btn");
+
+    // Text filter input
+    const textFilter = textInput.children().eq(0);
     expect(textFilter.attr("class")).toBe("devtools-plaininput text-filter");
     expect(textFilter.attr("placeholder")).toBe("Filter output");
     expect(textFilter.attr("type")).toBe("search");
     expect(textFilter.attr("value")).toBe("");
 
+    // Text filter input clear button
+    const textFilterClearButton = textInput.children().eq(1);
+    expect(textFilterClearButton.attr("class"))
+      .toBe("devtools-searchinput-clear clear-button");
+
     // "Persist logs" checkbox
     expect(wrapper.find(".filter-checkbox input").length).toBe(1);
   });
 
   it("displays the number of hidden messages when there are one hidden message", () => {
     const store = setupStore([
       "console.log('foobar', 'test')",
     ]);
--- a/devtools/client/webconsole/test/components/webconsole-wrapper.test.js
+++ b/devtools/client/webconsole/test/components/webconsole-wrapper.test.js
@@ -14,33 +14,34 @@ const {
   getMessageAt,
   getPrivatePacket,
 } = require("devtools/client/webconsole/test/helpers");
 
 const WebConsoleWrapper = require("devtools/client/webconsole/webconsole-wrapper");
 const { messagesAdd } = require("devtools/client/webconsole/actions/messages");
 
 async function getWebConsoleWrapper() {
+  const hud = { target: {client: {} } };
   const webConsoleUi = {
     emit: () => {},
+    hud,
     proxy: {
       releaseActor: () => {},
       target: {
         ensureCSSErrorReportingEnabled: () => {},
       },
     },
   };
 
-  const hud = { target: {client: {} } };
-  const wcow = new WebConsoleWrapper(null, webConsoleUi, null, hud);
+  const wcow = new WebConsoleWrapper(null, webConsoleUi, null, null);
   await wcow.init();
   return wcow;
 }
 
-describe("WebConsoleOutputWrapper", () => {
+describe("WebConsoleWrapper", () => {
   it("clears queues when dispatchMessagesClear is called", async () => {
     const ncow = await getWebConsoleWrapper();
     ncow.queuedMessageAdds.push({fakePacket: "message"});
     ncow.queuedMessageUpdates.push({fakePacket: "message-update"});
     ncow.queuedRequestUpdates.push({fakePacket: "request-update"});
 
     ncow.dispatchMessagesClear();
 
--- a/devtools/client/webconsole/types.js
+++ b/devtools/client/webconsole/types.js
@@ -44,16 +44,17 @@ exports.ConsoleMessage = function(props)
     errorMessageName: null,
     exceptionDocURL: null,
     executionPoint: undefined,
     userProvidedStyles: null,
     notes: null,
     indent: 0,
     prefix: "",
     private: false,
+    logpointId: undefined,
   }, props);
 };
 
 exports.NetworkEventMessage = function(props) {
   return Object.assign({
     id: null,
     actor: null,
     level: MESSAGE_LEVEL.LOG,