Skip to content
Snippets Groups Projects
Commit 89ea4a63 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Fatih Acet
Browse files

Extract setListDetail() into issue boards store

parent 7922270b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -66,7 +66,7 @@ export default {
eventHub.$emit('clearDetailIssue');
} else {
eventHub.$emit('newDetailIssue', this.issue);
boardsStore.detail.list = this.list;
boardsStore.setListDetail(this.list);
}
}
},
Loading
Loading
Loading
Loading
@@ -73,7 +73,7 @@ export default {
$(this.$refs.submitButton).enable();
 
boardsStore.setIssueDetail(issue);
boardsStore.detail.list = this.list;
boardsStore.setListDetail(this.list);
})
.catch(() => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions
Loading
Loading
Loading
Loading
@@ -207,6 +207,10 @@ const boardsStore = {
eventHub.$emit('updateTokens');
},
 
setListDetail(newList) {
this.detail.list = newList;
},
updateFiltersUrl() {
window.history.pushState(null, null, `?${this.filter.path}`);
},
Loading
Loading
Loading
Loading
@@ -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';
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment