diff options
author | Phil Hughes <me@iamphill.com> | 2018-11-16 14:01:27 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-11-16 14:01:27 +0000 |
commit | 4e24ccc436e1678c79d71225a3cb9eb3c11ed17a (patch) | |
tree | 6d39db9a25f1719ea1b0befc6d88be1389d5a76d | |
parent | 4708f6aff2938bce1cbf519cdd1a75859293705c (diff) | |
parent | 4a2b19706c58074a31d2b3a7e80f15c89c8cf85b (diff) | |
download | gitlab-ce-4e24ccc436e1678c79d71225a3cb9eb3c11ed17a.tar.gz |
Merge branch 'gt-rename-diffs-store-variable' into 'master'
Rename diffs store variable
See merge request gitlab-org/gitlab-ce!23123
-rw-r--r-- | app/assets/javascripts/diffs/store/actions.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/store/getters.js | 2 | ||||
-rw-r--r-- | changelogs/unreleased/gt-rename-diffs-store-variable.yml | 5 | ||||
-rw-r--r-- | spec/javascripts/diffs/store/actions_spec.js | 6 | ||||
-rw-r--r-- | spec/javascripts/diffs/store/getters_spec.js | 8 |
5 files changed, 14 insertions, 9 deletions
diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index fb648527450..6354d3ce1e6 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -167,7 +167,7 @@ export const expandAllFiles = ({ commit }) => { export const toggleFileDiscussions = ({ getters, dispatch }, diff) => { const discussions = getters.getDiffFileDiscussions(diff); const shouldCloseAll = getters.diffHasAllExpandedDiscussions(diff); - const shouldExpandAll = getters.diffHasAllCollpasedDiscussions(diff); + const shouldExpandAll = getters.diffHasAllCollapsedDiscussions(diff); discussions.forEach(discussion => { const data = { discussionId: discussion.id }; diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index 7f02c67a64e..05e32e3c1f1 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -27,7 +27,7 @@ export const diffHasAllExpandedDiscussions = (state, getters) => diff => { * @param {Object} diff * @returns {Boolean} */ -export const diffHasAllCollpasedDiscussions = (state, getters) => diff => { +export const diffHasAllCollapsedDiscussions = (state, getters) => diff => { const discussions = getters.getDiffFileDiscussions(diff); return ( diff --git a/changelogs/unreleased/gt-rename-diffs-store-variable.yml b/changelogs/unreleased/gt-rename-diffs-store-variable.yml new file mode 100644 index 00000000000..0aed49f3d60 --- /dev/null +++ b/changelogs/unreleased/gt-rename-diffs-store-variable.yml @@ -0,0 +1,5 @@ +--- +title: Rename diffs store variable +merge_request: 23123 +author: George Tsiolis +type: other diff --git a/spec/javascripts/diffs/store/actions_spec.js b/spec/javascripts/diffs/store/actions_spec.js index d94a9cd1710..acd95a3dd8b 100644 --- a/spec/javascripts/diffs/store/actions_spec.js +++ b/spec/javascripts/diffs/store/actions_spec.js @@ -416,7 +416,7 @@ describe('DiffsStoreActions', () => { const getters = { getDiffFileDiscussions: jasmine.createSpy().and.returnValue([{ id: 1 }]), diffHasAllExpandedDiscussions: jasmine.createSpy().and.returnValue(true), - diffHasAllCollpasedDiscussions: jasmine.createSpy().and.returnValue(false), + diffHasAllCollapsedDiscussions: jasmine.createSpy().and.returnValue(false), }; const dispatch = jasmine.createSpy('dispatch'); @@ -434,7 +434,7 @@ describe('DiffsStoreActions', () => { const getters = { getDiffFileDiscussions: jasmine.createSpy().and.returnValue([{ id: 1 }]), diffHasAllExpandedDiscussions: jasmine.createSpy().and.returnValue(false), - diffHasAllCollpasedDiscussions: jasmine.createSpy().and.returnValue(true), + diffHasAllCollapsedDiscussions: jasmine.createSpy().and.returnValue(true), }; const dispatch = jasmine.createSpy(); @@ -452,7 +452,7 @@ describe('DiffsStoreActions', () => { const getters = { getDiffFileDiscussions: jasmine.createSpy().and.returnValue([{ expanded: false, id: 1 }]), diffHasAllExpandedDiscussions: jasmine.createSpy().and.returnValue(false), - diffHasAllCollpasedDiscussions: jasmine.createSpy().and.returnValue(false), + diffHasAllCollapsedDiscussions: jasmine.createSpy().and.returnValue(false), }; const dispatch = jasmine.createSpy(); diff --git a/spec/javascripts/diffs/store/getters_spec.js b/spec/javascripts/diffs/store/getters_spec.js index 2449bb65d07..eef95c823fb 100644 --- a/spec/javascripts/diffs/store/getters_spec.js +++ b/spec/javascripts/diffs/store/getters_spec.js @@ -106,13 +106,13 @@ describe('Diffs Module Getters', () => { }); }); - describe('diffHasAllCollpasedDiscussions', () => { + describe('diffHasAllCollapsedDiscussions', () => { it('returns true when all discussions are collapsed', () => { discussionMock.diff_file.file_hash = diffFileMock.fileHash; discussionMock.expanded = false; expect( - getters.diffHasAllCollpasedDiscussions(localState, { + getters.diffHasAllCollapsedDiscussions(localState, { getDiffFileDiscussions: () => [discussionMock], })(diffFileMock), ).toEqual(true); @@ -120,7 +120,7 @@ describe('Diffs Module Getters', () => { it('returns false when there are no discussions', () => { expect( - getters.diffHasAllCollpasedDiscussions(localState, { + getters.diffHasAllCollapsedDiscussions(localState, { getDiffFileDiscussions: () => [], })(diffFileMock), ).toEqual(false); @@ -130,7 +130,7 @@ describe('Diffs Module Getters', () => { discussionMock1.expanded = false; expect( - getters.diffHasAllCollpasedDiscussions(localState, { + getters.diffHasAllCollapsedDiscussions(localState, { getDiffFileDiscussions: () => [discussionMock, discussionMock1], })(diffFileMock), ).toEqual(false); |