From f693c1be04205b99ce91ba0d7b523992418fc575 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Mon, 3 Jun 2019 16:42:55 +0200 Subject: Add setListDetail() to issue boards store --- app/assets/javascripts/boards/stores/boards_store.js | 4 ++++ spec/javascripts/boards/boards_store_spec.js | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index f72ab189015..4b3b44574a8 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -207,6 +207,10 @@ const boardsStore = { eventHub.$emit('updateTokens'); }, + setListDetail(newList) { + this.detail.list = newList; + }, + updateFiltersUrl() { window.history.pushState(null, null, `?${this.filter.path}`); }, diff --git a/spec/javascripts/boards/boards_store_spec.js b/spec/javascripts/boards/boards_store_spec.js index 68e66346bfd..b5559db8784 100644 --- a/spec/javascripts/boards/boards_store_spec.js +++ b/spec/javascripts/boards/boards_store_spec.js @@ -312,6 +312,17 @@ describe('Store', () => { }); }); + describe('setListDetail', () => { + it('sets the list detail', () => { + boardsStore.detail.list = 'not a list'; + + const dummyValue = 'new list'; + boardsStore.setListDetail(dummyValue); + + expect(boardsStore.detail.list).toEqual(dummyValue); + }); + }); + describe('clearDetailIssue', () => { it('resets issue details', () => { boardsStore.detail.issue = 'something'; -- cgit v1.2.1