From bddcac1672132779c834f20000e24c0a07d1fe25 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 5 Jan 2018 18:40:44 +0100 Subject: [PATCH] Bug 1428394 - Fix mocha sidebar tests; r=Honza. The tests were failing because all the sidebarToggle actions were renamed to sideBarClose, which made the tests inacurate. MozReview-Commit-ID: LBkqTzNhaqV --HG-- extra : rebase_source : 5943924d6fb073cb2375df275665de206aaf857b --- .../new-console-output/test/store/ui.test.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/devtools/client/webconsole/new-console-output/test/store/ui.test.js b/devtools/client/webconsole/new-console-output/test/store/ui.test.js index f6ade258fafc..fb467febe9ae 100644 --- a/devtools/client/webconsole/new-console-output/test/store/ui.test.js +++ b/devtools/client/webconsole/new-console-output/test/store/ui.test.js @@ -18,7 +18,14 @@ describe("Testing UI", () => { describe("Toggle sidebar", () => { it("sidebar is toggled on and off", () => { - store.dispatch(actions.sidebarClose()); + const packet = stubPackets.get("inspect({a: 1})"); + const message = stubPreparedMessages.get("inspect({a: 1})"); + store.dispatch(actions.messageAdd(packet)); + + const actorId = message.parameters[0].actor; + const messageId = getFirstMessage(store.getState()).id; + store.dispatch(actions.showObjectInSidebar(actorId, messageId)); + expect(store.getState().ui.sidebarVisible).toEqual(true); store.dispatch(actions.sidebarClose()); expect(store.getState().ui.sidebarVisible).toEqual(false); @@ -27,7 +34,14 @@ describe("Testing UI", () => { describe("Hide sidebar on clear", () => { it("sidebar is hidden on clear", () => { - store.dispatch(actions.sidebarClose()); + const packet = stubPackets.get("inspect({a: 1})"); + const message = stubPreparedMessages.get("inspect({a: 1})"); + store.dispatch(actions.messageAdd(packet)); + + const actorId = message.parameters[0].actor; + const messageId = getFirstMessage(store.getState()).id; + store.dispatch(actions.showObjectInSidebar(actorId, messageId)); + expect(store.getState().ui.sidebarVisible).toEqual(true); store.dispatch(actions.messagesClear()); expect(store.getState().ui.sidebarVisible).toEqual(false);