Bug 1438476 - Fix mocha tests broken due to React 16 update; r=ochameau.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Thu, 15 Feb 2018 12:27:52 +0100
changeset 404255 01e06518eb958b8decdc90156b61d8b7e416262c
parent 404254 9610e7e1386533f4c3f61ae920743903defda25d
child 404256 7b08a8b076fdc347fb507f923d243ab1c23b1f78
push id99968
push userrgurzau@mozilla.com
push dateFri, 16 Feb 2018 22:14:56 +0000
treeherdermozilla-inbound@2e16779c96cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1438476
milestone60.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 1438476 - Fix mocha tests broken due to React 16 update; r=ochameau. MozReview-Commit-ID: 9v2sWMSA7pG
devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js
--- a/devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js
+++ b/devtools/client/webconsole/new-console-output/test/components/evaluation-result.test.js
@@ -52,25 +52,25 @@ describe("EvaluationResult component:", 
     expect(wrapper.hasClass("error")).toBe(true);
   });
 
   it("renders thrown empty string", () => {
     const message = stubPreparedMessages.get(`eval throw ""`);
     const wrapper = render(EvaluationResult({ message, serviceContainer }));
     const text = wrapper.find(".message-body").text();
     expect(text).toBe("Error");
-    expect(wrapper.find(".message.error").length).toBe(1);
+    expect(wrapper.hasClass("error")).toBe(true);
   });
 
   it("renders thrown string", () => {
     const message = stubPreparedMessages.get(`eval throw "tomato"`);
     const wrapper = render(EvaluationResult({ message, serviceContainer }));
     const text = wrapper.find(".message-body").text();
     expect(text).toBe("Error: tomato");
-    expect(wrapper.find(".message.error").length).toBe(1);
+    expect(wrapper.hasClass("error")).toBe(true);
   });
 
   it("renders an inspect command result", () => {
     const message = stubPreparedMessages.get("inspect({a: 1})");
     const wrapper = render(EvaluationResult({ message, serviceContainer }));
 
     expect(wrapper.find(".message-body").text()).toBe("Object { a: 1 }");
   });