Extract setIssueDetail() into issue boards store
This commit is contained in:
parent
f4cb5d2beb
commit
0c93e470fd
|
@ -72,7 +72,7 @@ export default {
|
||||||
// Need this because our jQuery very kindly disables buttons on ALL form submissions
|
// Need this because our jQuery very kindly disables buttons on ALL form submissions
|
||||||
$(this.$refs.submitButton).enable();
|
$(this.$refs.submitButton).enable();
|
||||||
|
|
||||||
boardsStore.detail.issue = issue;
|
boardsStore.setIssueDetail(issue);
|
||||||
boardsStore.detail.list = this.list;
|
boardsStore.detail.list = this.list;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
@ -168,7 +168,7 @@ export default () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
boardsStore.detail.issue = newIssue;
|
boardsStore.setIssueDetail(newIssue);
|
||||||
},
|
},
|
||||||
clearDetailIssue() {
|
clearDetailIssue() {
|
||||||
boardsStore.clearDetailIssue();
|
boardsStore.clearDetailIssue();
|
||||||
|
|
|
@ -212,7 +212,11 @@ const boardsStore = {
|
||||||
},
|
},
|
||||||
|
|
||||||
clearDetailIssue() {
|
clearDetailIssue() {
|
||||||
this.detail.issue = {};
|
this.setIssueDetail({});
|
||||||
|
},
|
||||||
|
|
||||||
|
setIssueDetail(issueDetail) {
|
||||||
|
this.detail.issue = issueDetail;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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', () => {
|
describe('startMoving', () => {
|
||||||
it('stores list and issue', () => {
|
it('stores list and issue', () => {
|
||||||
const dummyIssue = 'some issue';
|
const dummyIssue = 'some issue';
|
||||||
|
|
Loading…
Reference in New Issue