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

Updated variable name to forceExpanded

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