Commit ed5ecec1 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Phil Hughes

Extract clearDetailIssue() to issue boards store

parent 101733b5
...@@ -48,7 +48,7 @@ export default Vue.extend({ ...@@ -48,7 +48,7 @@ export default Vue.extend({
list.removeIssue(issue); list.removeIssue(issue);
}); });
boardsStore.detail.issue = {}; boardsStore.clearDetailIssue();
}, },
/** /**
* Build the default patch request. * Build the default patch request.
......
...@@ -167,7 +167,7 @@ export default () => { ...@@ -167,7 +167,7 @@ export default () => {
boardsStore.detail.issue = newIssue; boardsStore.detail.issue = newIssue;
}, },
clearDetailIssue() { clearDetailIssue() {
boardsStore.detail.issue = {}; boardsStore.clearDetailIssue();
}, },
toggleSubscription(id) { toggleSubscription(id) {
const { issue } = boardsStore.detail; const { issue } = boardsStore.detail;
......
...@@ -188,6 +188,10 @@ const boardsStore = { ...@@ -188,6 +188,10 @@ const boardsStore = {
updateFiltersUrl() { updateFiltersUrl() {
window.history.pushState(null, null, `?${this.filter.path}`); window.history.pushState(null, null, `?${this.filter.path}`);
}, },
clearDetailIssue() {
this.detail.issue = {};
},
}; };
BoardsStoreEE.initEESpecific(boardsStore); BoardsStoreEE.initEESpecific(boardsStore);
......
...@@ -268,4 +268,14 @@ describe('Store', () => { ...@@ -268,4 +268,14 @@ describe('Store', () => {
}); });
}); });
}); });
describe('clearDetailIssue', () => {
it('resets issue details', () => {
boardsStore.detail.issue = 'something';
boardsStore.clearDetailIssue();
expect(boardsStore.detail.issue).toEqual({});
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment