Commit 5b71c8b2 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Fatih Acet

Add setCurrentBoard to boardsStore

(cherry picked from commit 9cd745c65bcb51d615399e82d8b26ef5cce972e1)
parent 939563a7
...@@ -374,6 +374,10 @@ const boardsStore = { ...@@ -374,6 +374,10 @@ const boardsStore = {
deleteBoard({ id }) { deleteBoard({ id }) {
return axios.delete(this.generateBoardsPath(id)); return axios.delete(this.generateBoardsPath(id));
}, },
setCurrentBoard(board) {
this.state.currentBoard = board;
},
}; };
BoardsStoreEE.initEESpecific(boardsStore); BoardsStoreEE.initEESpecific(boardsStore);
......
...@@ -365,4 +365,17 @@ describe('Store', () => { ...@@ -365,4 +365,17 @@ describe('Store', () => {
expect(boardsStore.timeTracking.limitToHours).toEqual(true); expect(boardsStore.timeTracking.limitToHours).toEqual(true);
}); });
}); });
describe('setCurrentBoard', () => {
const dummyBoard = 'hoverboard';
it('sets the current board', () => {
const { state } = boardsStore;
state.currentBoard = null;
boardsStore.setCurrentBoard(dummyBoard);
expect(state.currentBoard).toEqual(dummyBoard);
});
});
}); });
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