Commit 7aa88030 authored by Phil Hughes's avatar Phil Hughes

Updated variable name to forceExpanded

parent b8ee8c27
...@@ -56,12 +56,12 @@ export default { ...@@ -56,12 +56,12 @@ export default {
return `${noteData.author.name}: ${note}`; return `${noteData.author.name}: ${note}`;
}, },
toggleDiscussions() { toggleDiscussions() {
const shouldExpand = this.discussions.some(discussion => !discussion.expanded); const forceExpanded = this.discussions.some(discussion => !discussion.expanded);
this.discussions.forEach(discussion => { this.discussions.forEach(discussion => {
this.toggleDiscussion({ this.toggleDiscussion({
discussionId: discussion.id, discussionId: discussion.id,
shouldExpand, forceExpanded,
}); });
}); });
}, },
......
...@@ -178,10 +178,10 @@ export default { ...@@ -178,10 +178,10 @@ export default {
} }
}, },
[types.TOGGLE_DISCUSSION](state, { discussionId, shouldExpand = null }) { [types.TOGGLE_DISCUSSION](state, { discussionId, forceExpanded = null }) {
const discussion = utils.findNoteObjectById(state.discussions, discussionId); const discussion = utils.findNoteObjectById(state.discussions, discussionId);
Object.assign(discussion, { Object.assign(discussion, {
expanded: shouldExpand === null ? !discussion.expanded : shouldExpand, expanded: forceExpanded === null ? !discussion.expanded : forceExpanded,
}); });
}, },
......
...@@ -106,7 +106,7 @@ describe('DiffGutterAvatars', () => { ...@@ -106,7 +106,7 @@ describe('DiffGutterAvatars', () => {
'toggleDiscussion', 'toggleDiscussion',
{ {
discussionId: component.discussions[0].id, discussionId: component.discussions[0].id,
shouldExpand: true, forceExpanded: true,
}, },
]); ]);
...@@ -114,7 +114,7 @@ describe('DiffGutterAvatars', () => { ...@@ -114,7 +114,7 @@ describe('DiffGutterAvatars', () => {
'toggleDiscussion', 'toggleDiscussion',
{ {
discussionId: component.discussions[1].id, discussionId: component.discussions[1].id,
shouldExpand: true, forceExpanded: true,
}, },
]); ]);
}); });
......
...@@ -303,7 +303,7 @@ describe('Notes Store mutations', () => { ...@@ -303,7 +303,7 @@ describe('Notes Store mutations', () => {
discussions: [{ ...discussionMock, expanded: false }], discussions: [{ ...discussionMock, expanded: false }],
}; };
mutations.TOGGLE_DISCUSSION(state, { discussionId: discussionMock.id, shouldExpand: true }); mutations.TOGGLE_DISCUSSION(state, { discussionId: discussionMock.id, forceExpanded: true });
expect(state.discussions[0].expanded).toEqual(true); expect(state.discussions[0].expanded).toEqual(true);
}); });
......
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