diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-20 12:11:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-20 12:11:11 +0300 |
commit | 9fa24e4f9c5440e2ddc27cd787df5f5e669bed25 (patch) | |
tree | 6e0d1985050d6ef76ff1e451dce0eebcabc1e43e /spec/frontend | |
parent | fe9e084c1de1c8bb98172b7bf7a61ca044878173 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/diffs/components/app_spec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/frontend/diffs/components/app_spec.js b/spec/frontend/diffs/components/app_spec.js index 212def72b90..e874345cdd3 100644 --- a/spec/frontend/diffs/components/app_spec.js +++ b/spec/frontend/diffs/components/app_spec.js @@ -769,6 +769,15 @@ describe('diffs/components/app', () => { beforeEach(() => { createComponent(); + + store.state.diffs.diffFiles = [ + { + file_hash: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a', + highlighted_diff_lines: [], + viewer: { manuallyCollapsed: true }, + }, + ]; + loadSpy = jest.spyOn(wrapper.vm, 'loadCollapsedDiff').mockResolvedValue('resolved'); }); @@ -787,5 +796,14 @@ describe('diffs/components/app', () => { expect(loadSpy).toHaveBeenCalledWith({ file: store.state.diffs.diffFiles[0] }); }); + + it('does nothing when file is not collapsed', () => { + store.state.diffs.diffFiles[0].viewer.manuallyCollapsed = false; + window.location.hash = '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_0_1'; + + eventHub.$emit('doneLoadingBatches'); + + expect(loadSpy).not.toHaveBeenCalledWith({ file: store.state.diffs.diffFiles[0] }); + }); }); }); |