diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-12 12:08:27 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-12 12:08:27 +0000 |
| commit | e0d7577e29dcab90623e1f38cf11b351c665ee23 (patch) | |
| tree | 5a34f26be66301f1af9e36b10a67dfca01fed8ec /spec/frontend/diffs/components | |
| parent | 60e7627c998b74d48df10b9a7759d6038a1f139c (diff) | |
| download | gitlab-ce-e0d7577e29dcab90623e1f38cf11b351c665ee23.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs/components')
| -rw-r--r-- | spec/frontend/diffs/components/app_spec.js | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/spec/frontend/diffs/components/app_spec.js b/spec/frontend/diffs/components/app_spec.js index 545ba4a0e04..ab01c3e528e 100644 --- a/spec/frontend/diffs/components/app_spec.js +++ b/spec/frontend/diffs/components/app_spec.js @@ -715,19 +715,27 @@ describe('diffs/components/app', () => { }); it.each` - currentDiffFileId | targetFile - ${'123'} | ${2} - ${'312'} | ${1} + currentDiffFileId | targetFile | newFileByFile + ${'123'} | ${2} | ${false} + ${'312'} | ${1} | ${true} `( 'calls navigateToDiffFileIndex with $index when $link is clicked', - async ({ currentDiffFileId, targetFile }) => { - createComponent({ fileByFileUserPreference: true }, ({ state }) => { - state.diffs.treeEntries = { - 123: { type: 'blob', fileHash: '123' }, - 312: { type: 'blob', fileHash: '312' }, - }; - state.diffs.currentDiffFileId = currentDiffFileId; - }); + async ({ currentDiffFileId, targetFile, newFileByFile }) => { + createComponent( + { fileByFileUserPreference: true }, + ({ state }) => { + state.diffs.treeEntries = { + 123: { type: 'blob', fileHash: '123', filePaths: { old: '1234', new: '123' } }, + 312: { type: 'blob', fileHash: '312', filePaths: { old: '3124', new: '312' } }, + }; + state.diffs.currentDiffFileId = currentDiffFileId; + }, + { + glFeatures: { + singleFileFileByFile: newFileByFile, + }, + }, + ); await nextTick(); @@ -737,7 +745,10 @@ describe('diffs/components/app', () => { await nextTick(); - expect(wrapper.vm.navigateToDiffFileIndex).toHaveBeenCalledWith(targetFile - 1); + expect(wrapper.vm.navigateToDiffFileIndex).toHaveBeenCalledWith({ + index: targetFile - 1, + singleFile: newFileByFile, + }); }, ); }); |
