diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-26 18:09:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-26 18:09:30 +0300 |
commit | 2eaa60e4555bb11ad5c0af905217f0fa61cf7cc9 (patch) | |
tree | 0b0096203355150802fb8f7f4fe208b41b5bed68 /spec/frontend/diffs | |
parent | 142890d5bbefa7b1e1b30f263f9ad67d9d496d29 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs')
-rw-r--r-- | spec/frontend/diffs/components/diff_row_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/diffs/store/utils_spec.js | 17 |
2 files changed, 6 insertions, 17 deletions
diff --git a/spec/frontend/diffs/components/diff_row_spec.js b/spec/frontend/diffs/components/diff_row_spec.js index f9e76cf8107..0ec075c8ad8 100644 --- a/spec/frontend/diffs/components/diff_row_spec.js +++ b/spec/frontend/diffs/components/diff_row_spec.js @@ -97,18 +97,18 @@ describe('DiffRow', () => { ${'right'} `('$side side', ({ side }) => { it(`renders empty cells if ${side} is unavailable`, () => { - const wrapper = createWrapper({ props: { line: testLines[2] } }); + const wrapper = createWrapper({ props: { line: testLines[2], inline: false } }); expect(wrapper.find(`[data-testid="${side}LineNumber"]`).exists()).toBe(false); expect(wrapper.find(`[data-testid="${side}EmptyCell"]`).exists()).toBe(true); }); it('renders comment button', () => { - const wrapper = createWrapper({ props: { line: testLines[3] } }); + const wrapper = createWrapper({ props: { line: testLines[3], inline: false } }); expect(wrapper.find(`[data-testid="${side}CommentButton"]`).exists()).toBe(true); }); it('renders avatars', () => { - const wrapper = createWrapper({ props: { line: testLines[0] } }); + const wrapper = createWrapper({ props: { line: testLines[0], inline: false } }); expect(wrapper.find(`[data-testid="${side}Discussions"]`).exists()).toBe(true); }); }); diff --git a/spec/frontend/diffs/store/utils_spec.js b/spec/frontend/diffs/store/utils_spec.js index 181d562661f..a78c4c2d065 100644 --- a/spec/frontend/diffs/store/utils_spec.js +++ b/spec/frontend/diffs/store/utils_spec.js @@ -1119,25 +1119,14 @@ describe('DiffsStoreUtils', () => { ); }); - /** - * 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', () => { + it('converts inline diff lines', () => { 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); + expect(files[6].left).toEqual(file.parallel_diff_lines[5].right); + expect(files[6].right).toBeNull(); }); }); }); |