Add setCurrentBoard to boardsStore

(cherry picked from commit 9cd745c65bcb51d615399e82d8b26ef5cce972e1)
This commit is contained in:
Winnie Hellmann 2019-07-15 23:42:26 +00:00 committed by Fatih Acet
parent 939563a7d2
commit 5b71c8b259
2 changed files with 17 additions and 0 deletions

View file

@ -374,6 +374,10 @@ const boardsStore = {
deleteBoard({ id }) {
return axios.delete(this.generateBoardsPath(id));
},
setCurrentBoard(board) {
this.state.currentBoard = board;
},
};
BoardsStoreEE.initEESpecific(boardsStore);

View file

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