Bug 1399161 - Fix filter bar mocha test. r=Honza
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 12 Sep 2017 17:43:38 +0200
changeset 430380 7d519539e6684c9a26b674ff62140e2f13de2ef5
parent 430379 cf7a1267d47b09edb0da713b213e2509c0f9dc7f
child 430381 5c50e8581fedf2ef3a218574f705c71cc20e2cd8
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1399161
milestone57.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 1399161 - Fix filter bar mocha test. r=Honza MozReview-Commit-ID: Jd5QkCrnLKq
devtools/client/webconsole/new-console-output/test/components/filter-bar.test.js
--- a/devtools/client/webconsole/new-console-output/test/components/filter-bar.test.js
+++ b/devtools/client/webconsole/new-console-output/test/components/filter-bar.test.js
@@ -27,31 +27,34 @@ describe("FilterBar component:", () => {
     const store = setupStore([]);
 
     const wrapper = render(Provider({store}, FilterBar({ serviceContainer })));
     const toolbar = wrapper.find(
       ".devtools-toolbar.webconsole-filterbar-primary"
     );
 
     // Clear button
-    expect(toolbar.children().eq(0).attr("class"))
-      .toBe("devtools-button devtools-clear-icon");
-    expect(toolbar.children().eq(0).attr("title")).toBe("Clear the Web Console output");
+    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");
 
     // Filter bar toggle
-    expect(toolbar.children().eq(1).attr("class"))
-      .toBe("devtools-button devtools-filter-icon");
-    expect(toolbar.children().eq(1).attr("title")).toBe("Toggle filter bar");
+    const filterBarButton = toolbar.children().eq(2);
+    expect(filterBarButton.attr("class")).toBe("devtools-button devtools-filter-icon");
+    expect(filterBarButton.attr("title")).toBe("Toggle filter bar");
 
     // Text filter
-    expect(toolbar.children().eq(2).attr("class"))
-      .toBe("devtools-plaininput text-filter");
-    expect(toolbar.children().eq(2).attr("placeholder")).toBe("Filter output");
-    expect(toolbar.children().eq(2).attr("type")).toBe("search");
-    expect(toolbar.children().eq(2).attr("value")).toBe("");
+    const textFilter = toolbar.children().eq(3);
+    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("");
   });
 
   it("displays the number of hidden messages when there are one hidden message", () => {
     const store = setupStore([
       "console.log('foobar', 'test')"
     ]);
     // Filter-out LOG messages
     store.dispatch(actions.filterToggle(FILTERS.LOG));