Skip to content
Snippets Groups Projects
Commit 0c93e470 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Clement Ho
Browse files

Extract setIssueDetail() into issue boards store

parent f4cb5d2b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -72,7 +72,7 @@ export default {
// Need this because our jQuery very kindly disables buttons on ALL form submissions
$(this.$refs.submitButton).enable();
 
boardsStore.detail.issue = issue;
boardsStore.setIssueDetail(issue);
boardsStore.detail.list = this.list;
})
.catch(() => {
Loading
Loading
Loading
Loading
@@ -168,7 +168,7 @@ export default () => {
});
}
 
boardsStore.detail.issue = newIssue;
boardsStore.setIssueDetail(newIssue);
},
clearDetailIssue() {
boardsStore.clearDetailIssue();
Loading
Loading
Loading
Loading
@@ -212,7 +212,11 @@ const boardsStore = {
},
 
clearDetailIssue() {
this.detail.issue = {};
this.setIssueDetail({});
},
setIssueDetail(issueDetail) {
this.detail.issue = issueDetail;
},
};
 
Loading
Loading
Loading
Loading
@@ -322,6 +322,17 @@ describe('Store', () => {
});
});
 
describe('setIssueDetail', () => {
it('sets issue details', () => {
boardsStore.detail.issue = 'some details';
const dummyValue = 'new details';
boardsStore.setIssueDetail(dummyValue);
expect(boardsStore.detail.issue).toEqual(dummyValue);
});
});
describe('startMoving', () => {
it('stores list and issue', () => {
const dummyIssue = 'some issue';
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