Add setCurrentBoard to boardsStore
(cherry picked from commit 9cd745c65bcb51d615399e82d8b26ef5cce972e1)
This commit is contained in:
parent
939563a7d2
commit
5b71c8b259
2 changed files with 17 additions and 0 deletions
|
@ -374,6 +374,10 @@ const boardsStore = {
|
|||
deleteBoard({ id }) {
|
||||
return axios.delete(this.generateBoardsPath(id));
|
||||
},
|
||||
|
||||
setCurrentBoard(board) {
|
||||
this.state.currentBoard = board;
|
||||
},
|
||||
};
|
||||
|
||||
BoardsStoreEE.initEESpecific(boardsStore);
|
||||
|
|
|
@ -365,4 +365,17 @@ describe('Store', () => {
|
|||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue