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
This commit is contained in:
Nicolas Chevobbe 2018-01-05 18:40:44 +01:00
Родитель bcbb9ad79d
Коммит bddcac1672
1 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -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);