Commit 8e4ba9ae authored by Sudheer's avatar Sudheer Committed by sudheer
Browse files

MM-132223 Fix for error on leaveTeam (#2109)

parent c08c64c4
......@@ -396,9 +396,11 @@ export function emitUserLoggedOutEvent(redirectTo = '/', shouldSignalLogout = tr
}
export function toggleSideBarRightMenuAction() {
dispatch(closeRightHandSide());
dispatch(closeLhs());
dispatch(closeRhsMenu());
return (doDispatch) => {
doDispatch(closeRightHandSide());
doDispatch(closeLhs());
doDispatch(closeRhsMenu());
};
}
export function emitBrowserFocus(focus) {
......
......@@ -2,8 +2,19 @@
// See LICENSE.txt for license information.
import {browserHistory} from 'utils/browser_history';
import {closeRightHandSide, closeMenu as closeRhsMenu} from 'actions/views/rhs';
import {close as closeLhs} from 'actions/views/lhs';
import {redirectUserToDefaultTeam} from 'actions/global_actions.jsx';
import {redirectUserToDefaultTeam, toggleSideBarRightMenuAction} from 'actions/global_actions.jsx';
jest.mock('actions/views/rhs', () => ({
closeMenu: jest.fn(),
closeRightHandSide: jest.fn(),
}));
jest.mock('actions/views/lhs', () => ({
close: jest.fn(),
}));
describe('actions/global_actions', () => {
test('redirectUserToDefaultTeam', async () => {
......@@ -11,4 +22,12 @@ describe('actions/global_actions', () => {
await redirectUserToDefaultTeam();
expect(browserHistory.push).toHaveBeenCalledWith('/select_team');
});
test('toggleSideBarRightMenuAction', () => {
const dispatchMock = () => {};
toggleSideBarRightMenuAction()(dispatchMock);
expect(closeRhsMenu).toHaveBeenCalled();
expect(closeRightHandSide).toHaveBeenCalled();
expect(closeLhs).toHaveBeenCalled();
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment