diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/frontend/diffs/store/utils_spec.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/frontend/diffs/store/utils_spec.js')
-rw-r--r-- | spec/frontend/diffs/store/utils_spec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/diffs/store/utils_spec.js b/spec/frontend/diffs/store/utils_spec.js index 39a482c85ae..866be0abd22 100644 --- a/spec/frontend/diffs/store/utils_spec.js +++ b/spec/frontend/diffs/store/utils_spec.js @@ -1221,5 +1221,26 @@ describe('DiffsStoreUtils', () => { file.parallel_diff_lines, ); }); + + /** + * What's going on here? + * + * The inline version of parallelizeDiffLines simply keeps the difflines + * in the same order they are received as opposed to shuffling them + * to be "side by side". + * + * This keeps the underlying data structure the same which simplifies + * the components, but keeps the changes grouped together as users + * expect when viewing changes inline. + */ + it('converts inline diff lines to inline diff lines with a parallel structure', () => { + const file = getDiffFileMock(); + const files = utils.parallelizeDiffLines(file.highlighted_diff_lines, true); + + expect(files[5].left).toEqual(file.parallel_diff_lines[5].left); + expect(files[5].right).toBeNull(); + expect(files[6].left).toBeNull(); + expect(files[6].right).toEqual(file.parallel_diff_lines[5].right); + }); }); }); |