2018-06-21 08:22:40 -04:00
|
|
|
import * as utils from '~/diffs/store/utils';
|
|
|
|
import {
|
|
|
|
LINE_POSITION_LEFT,
|
|
|
|
LINE_POSITION_RIGHT,
|
|
|
|
TEXT_DIFF_POSITION_TYPE,
|
2018-09-11 04:35:00 -04:00
|
|
|
LEGACY_DIFF_NOTE_TYPE,
|
2018-06-21 08:22:40 -04:00
|
|
|
DIFF_NOTE_TYPE,
|
|
|
|
NEW_LINE_TYPE,
|
|
|
|
OLD_LINE_TYPE,
|
|
|
|
MATCH_LINE_TYPE,
|
|
|
|
PARALLEL_DIFF_VIEW_TYPE,
|
|
|
|
} from '~/diffs/constants';
|
|
|
|
import { MERGE_REQUEST_NOTEABLE_TYPE } from '~/notes/constants';
|
|
|
|
import diffFileMockData from '../mock_data/diff_file';
|
|
|
|
import { noteableDataMock } from '../../notes/mock_data';
|
|
|
|
|
2019-02-13 06:06:43 -05:00
|
|
|
const getDiffFileMock = () => JSON.parse(JSON.stringify(diffFileMockData));
|
2018-06-21 08:22:40 -04:00
|
|
|
|
|
|
|
describe('DiffsStoreUtils', () => {
|
|
|
|
describe('findDiffFile', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
const files = [{ file_hash: 1, name: 'one' }];
|
2018-06-21 08:22:40 -04:00
|
|
|
|
|
|
|
it('should return correct file', () => {
|
|
|
|
expect(utils.findDiffFile(files, 1).name).toEqual('one');
|
|
|
|
expect(utils.findDiffFile(files, 2)).toBeUndefined();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('getReversePosition', () => {
|
|
|
|
it('should return correct line position name', () => {
|
|
|
|
expect(utils.getReversePosition(LINE_POSITION_RIGHT)).toEqual(LINE_POSITION_LEFT);
|
|
|
|
expect(utils.getReversePosition(LINE_POSITION_LEFT)).toEqual(LINE_POSITION_RIGHT);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('findIndexInInlineLines and findIndexInParallelLines', () => {
|
|
|
|
const expectSet = (method, lines, invalidLines) => {
|
|
|
|
expect(method(lines, { oldLineNumber: 3, newLineNumber: 5 })).toEqual(4);
|
|
|
|
expect(method(invalidLines || lines, { oldLineNumber: 32, newLineNumber: 53 })).toEqual(-1);
|
|
|
|
};
|
|
|
|
|
|
|
|
describe('findIndexInInlineLines', () => {
|
|
|
|
it('should return correct index for given line numbers', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
expectSet(utils.findIndexInInlineLines, getDiffFileMock().highlighted_diff_lines);
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('findIndexInParallelLines', () => {
|
|
|
|
it('should return correct index for given line numbers', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
expectSet(utils.findIndexInParallelLines, getDiffFileMock().parallel_diff_lines, {});
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('removeMatchLine', () => {
|
|
|
|
it('should remove match line properly by regarding the bottom parameter', () => {
|
|
|
|
const diffFile = getDiffFileMock();
|
|
|
|
const lineNumbers = { oldLineNumber: 3, newLineNumber: 5 };
|
2018-11-09 14:48:41 -05:00
|
|
|
const inlineIndex = utils.findIndexInInlineLines(
|
|
|
|
diffFile.highlighted_diff_lines,
|
|
|
|
lineNumbers,
|
|
|
|
);
|
|
|
|
const parallelIndex = utils.findIndexInParallelLines(
|
|
|
|
diffFile.parallel_diff_lines,
|
|
|
|
lineNumbers,
|
|
|
|
);
|
|
|
|
const atInlineIndex = diffFile.highlighted_diff_lines[inlineIndex];
|
|
|
|
const atParallelIndex = diffFile.parallel_diff_lines[parallelIndex];
|
2018-06-21 08:22:40 -04:00
|
|
|
|
|
|
|
utils.removeMatchLine(diffFile, lineNumbers, false);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(diffFile.highlighted_diff_lines[inlineIndex]).not.toEqual(atInlineIndex);
|
|
|
|
expect(diffFile.parallel_diff_lines[parallelIndex]).not.toEqual(atParallelIndex);
|
2018-06-21 08:22:40 -04:00
|
|
|
|
|
|
|
utils.removeMatchLine(diffFile, lineNumbers, true);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(diffFile.highlighted_diff_lines[inlineIndex + 1]).not.toEqual(atInlineIndex);
|
|
|
|
expect(diffFile.parallel_diff_lines[parallelIndex + 1]).not.toEqual(atParallelIndex);
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('addContextLines', () => {
|
2019-02-13 06:06:43 -05:00
|
|
|
it('should add context lines', () => {
|
2018-06-21 08:22:40 -04:00
|
|
|
const diffFile = getDiffFileMock();
|
2018-11-09 14:48:41 -05:00
|
|
|
const inlineLines = diffFile.highlighted_diff_lines;
|
|
|
|
const parallelLines = diffFile.parallel_diff_lines;
|
2018-06-21 08:22:40 -04:00
|
|
|
const lineNumbers = { oldLineNumber: 3, newLineNumber: 5 };
|
2019-02-13 06:06:43 -05:00
|
|
|
const contextLines = [{ lineNumber: 42, line_code: '123' }];
|
|
|
|
const options = { inlineLines, parallelLines, contextLines, lineNumbers };
|
2018-11-09 14:48:41 -05:00
|
|
|
const inlineIndex = utils.findIndexInInlineLines(inlineLines, lineNumbers);
|
|
|
|
const parallelIndex = utils.findIndexInParallelLines(parallelLines, lineNumbers);
|
2018-06-21 08:22:40 -04:00
|
|
|
const normalizedParallelLine = {
|
|
|
|
left: options.contextLines[0],
|
|
|
|
right: options.contextLines[0],
|
2019-02-13 06:06:43 -05:00
|
|
|
line_code: '123',
|
2018-06-21 08:22:40 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
utils.addContextLines(options);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2019-02-13 06:06:43 -05:00
|
|
|
expect(inlineLines[inlineIndex]).toEqual(contextLines[0]);
|
|
|
|
expect(parallelLines[parallelIndex]).toEqual(normalizedParallelLine);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should add context lines properly with bottom parameter', () => {
|
|
|
|
const diffFile = getDiffFileMock();
|
|
|
|
const inlineLines = diffFile.highlighted_diff_lines;
|
|
|
|
const parallelLines = diffFile.parallel_diff_lines;
|
|
|
|
const lineNumbers = { oldLineNumber: 3, newLineNumber: 5 };
|
|
|
|
const contextLines = [{ lineNumber: 42, line_code: '123' }];
|
|
|
|
const options = { inlineLines, parallelLines, contextLines, lineNumbers, bottom: true };
|
|
|
|
const normalizedParallelLine = {
|
|
|
|
left: options.contextLines[0],
|
|
|
|
right: options.contextLines[0],
|
|
|
|
line_code: '123',
|
|
|
|
};
|
2018-06-21 08:22:40 -04:00
|
|
|
|
|
|
|
utils.addContextLines(options);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2019-02-13 06:06:43 -05:00
|
|
|
expect(inlineLines[inlineLines.length - 1]).toEqual(contextLines[0]);
|
|
|
|
expect(parallelLines[parallelLines.length - 1]).toEqual(normalizedParallelLine);
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('getNoteFormData', () => {
|
|
|
|
it('should properly create note form data', () => {
|
|
|
|
const diffFile = getDiffFileMock();
|
|
|
|
noteableDataMock.targetType = MERGE_REQUEST_NOTEABLE_TYPE;
|
|
|
|
|
|
|
|
const options = {
|
|
|
|
note: 'Hello world!',
|
|
|
|
noteableData: noteableDataMock,
|
|
|
|
noteableType: MERGE_REQUEST_NOTEABLE_TYPE,
|
|
|
|
diffFile,
|
|
|
|
noteTargetLine: {
|
2018-11-09 14:48:41 -05:00
|
|
|
line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
|
|
|
|
meta_data: null,
|
|
|
|
new_line: 3,
|
|
|
|
old_line: 1,
|
2018-06-21 08:22:40 -04:00
|
|
|
},
|
|
|
|
diffViewType: PARALLEL_DIFF_VIEW_TYPE,
|
|
|
|
linePosition: LINE_POSITION_LEFT,
|
|
|
|
};
|
|
|
|
|
|
|
|
const position = JSON.stringify({
|
2018-11-09 14:48:41 -05:00
|
|
|
base_sha: diffFile.diff_refs.base_sha,
|
|
|
|
start_sha: diffFile.diff_refs.start_sha,
|
|
|
|
head_sha: diffFile.diff_refs.head_sha,
|
|
|
|
old_path: diffFile.old_path,
|
|
|
|
new_path: diffFile.new_path,
|
2018-06-21 08:22:40 -04:00
|
|
|
position_type: TEXT_DIFF_POSITION_TYPE,
|
2018-11-09 14:48:41 -05:00
|
|
|
old_line: options.noteTargetLine.old_line,
|
|
|
|
new_line: options.noteTargetLine.new_line,
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const postData = {
|
|
|
|
view: options.diffViewType,
|
|
|
|
line_type: options.linePosition === LINE_POSITION_RIGHT ? NEW_LINE_TYPE : OLD_LINE_TYPE,
|
2018-11-09 14:48:41 -05:00
|
|
|
merge_request_diff_head_sha: diffFile.diff_refs.head_sha,
|
2018-06-21 08:22:40 -04:00
|
|
|
in_reply_to_discussion_id: '',
|
|
|
|
note_project_id: '',
|
|
|
|
target_type: options.noteableType,
|
|
|
|
target_id: options.noteableData.id,
|
2018-09-19 17:23:13 -04:00
|
|
|
return_discussion: true,
|
2018-06-21 08:22:40 -04:00
|
|
|
note: {
|
|
|
|
noteable_type: options.noteableType,
|
|
|
|
noteable_id: options.noteableData.id,
|
2018-11-26 14:36:06 -05:00
|
|
|
commit_id: undefined,
|
2018-06-21 08:22:40 -04:00
|
|
|
type: DIFF_NOTE_TYPE,
|
2018-11-09 14:48:41 -05:00
|
|
|
line_code: options.noteTargetLine.line_code,
|
2018-06-21 08:22:40 -04:00
|
|
|
note: options.note,
|
|
|
|
position,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
expect(utils.getNoteFormData(options)).toEqual({
|
|
|
|
endpoint: options.noteableData.create_note_path,
|
|
|
|
data: postData,
|
|
|
|
});
|
|
|
|
});
|
2018-09-11 04:35:00 -04:00
|
|
|
|
|
|
|
it('should create legacy note form data', () => {
|
|
|
|
const diffFile = getDiffFileMock();
|
2018-11-09 14:48:41 -05:00
|
|
|
delete diffFile.diff_refs.start_sha;
|
|
|
|
delete diffFile.diff_refs.head_sha;
|
2018-09-11 04:35:00 -04:00
|
|
|
|
|
|
|
noteableDataMock.targetType = MERGE_REQUEST_NOTEABLE_TYPE;
|
|
|
|
|
|
|
|
const options = {
|
|
|
|
note: 'Hello world!',
|
|
|
|
noteableData: noteableDataMock,
|
|
|
|
noteableType: MERGE_REQUEST_NOTEABLE_TYPE,
|
|
|
|
diffFile,
|
|
|
|
noteTargetLine: {
|
2018-11-09 14:48:41 -05:00
|
|
|
line_code: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_3',
|
|
|
|
meta_data: null,
|
|
|
|
new_line: 3,
|
|
|
|
old_line: 1,
|
2018-09-11 04:35:00 -04:00
|
|
|
},
|
|
|
|
diffViewType: PARALLEL_DIFF_VIEW_TYPE,
|
|
|
|
linePosition: LINE_POSITION_LEFT,
|
|
|
|
};
|
|
|
|
|
|
|
|
const position = JSON.stringify({
|
2018-11-09 14:48:41 -05:00
|
|
|
base_sha: diffFile.diff_refs.base_sha,
|
2018-09-11 04:35:00 -04:00
|
|
|
start_sha: undefined,
|
2018-09-14 05:17:31 -04:00
|
|
|
head_sha: undefined,
|
2018-11-09 14:48:41 -05:00
|
|
|
old_path: diffFile.old_path,
|
|
|
|
new_path: diffFile.new_path,
|
2018-09-11 04:35:00 -04:00
|
|
|
position_type: TEXT_DIFF_POSITION_TYPE,
|
2018-11-09 14:48:41 -05:00
|
|
|
old_line: options.noteTargetLine.old_line,
|
|
|
|
new_line: options.noteTargetLine.new_line,
|
2018-09-11 04:35:00 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const postData = {
|
|
|
|
view: options.diffViewType,
|
|
|
|
line_type: options.linePosition === LINE_POSITION_RIGHT ? NEW_LINE_TYPE : OLD_LINE_TYPE,
|
2018-09-14 05:17:31 -04:00
|
|
|
merge_request_diff_head_sha: undefined,
|
2018-09-11 04:35:00 -04:00
|
|
|
in_reply_to_discussion_id: '',
|
|
|
|
note_project_id: '',
|
|
|
|
target_type: options.noteableType,
|
|
|
|
target_id: options.noteableData.id,
|
2018-09-19 17:23:13 -04:00
|
|
|
return_discussion: true,
|
2018-09-11 04:35:00 -04:00
|
|
|
note: {
|
|
|
|
noteable_type: options.noteableType,
|
|
|
|
noteable_id: options.noteableData.id,
|
2018-11-26 14:36:06 -05:00
|
|
|
commit_id: undefined,
|
2018-09-11 04:35:00 -04:00
|
|
|
type: LEGACY_DIFF_NOTE_TYPE,
|
2018-11-09 14:48:41 -05:00
|
|
|
line_code: options.noteTargetLine.line_code,
|
2018-09-11 04:35:00 -04:00
|
|
|
note: options.note,
|
|
|
|
position,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
expect(utils.getNoteFormData(options)).toEqual({
|
|
|
|
endpoint: options.noteableData.create_note_path,
|
|
|
|
data: postData,
|
|
|
|
});
|
|
|
|
});
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('addLineReferences', () => {
|
|
|
|
const lineNumbers = { oldLineNumber: 3, newLineNumber: 4 };
|
|
|
|
|
|
|
|
it('should add correct line references when bottom set to true', () => {
|
|
|
|
const lines = [{ type: null }, { type: MATCH_LINE_TYPE }];
|
|
|
|
const linesWithReferences = utils.addLineReferences(lines, lineNumbers, true);
|
|
|
|
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(linesWithReferences[0].old_line).toEqual(lineNumbers.oldLineNumber + 1);
|
|
|
|
expect(linesWithReferences[0].new_line).toEqual(lineNumbers.newLineNumber + 1);
|
|
|
|
expect(linesWithReferences[1].meta_data.old_pos).toEqual(4);
|
|
|
|
expect(linesWithReferences[1].meta_data.new_pos).toEqual(5);
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should add correct line references when bottom falsy', () => {
|
|
|
|
const lines = [{ type: null }, { type: MATCH_LINE_TYPE }, { type: null }];
|
|
|
|
const linesWithReferences = utils.addLineReferences(lines, lineNumbers);
|
|
|
|
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(linesWithReferences[0].old_line).toEqual(0);
|
|
|
|
expect(linesWithReferences[0].new_line).toEqual(1);
|
|
|
|
expect(linesWithReferences[1].meta_data.old_pos).toEqual(2);
|
|
|
|
expect(linesWithReferences[1].meta_data.new_pos).toEqual(3);
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
2019-08-09 22:36:32 -04:00
|
|
|
|
|
|
|
it('should add correct line references when isExpandDown is true', () => {
|
|
|
|
const lines = [{ type: null }, { type: MATCH_LINE_TYPE }];
|
|
|
|
const linesWithReferences = utils.addLineReferences(lines, lineNumbers, false, true, {
|
|
|
|
old_line: 10,
|
|
|
|
new_line: 11,
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(linesWithReferences[1].meta_data.old_pos).toEqual(10);
|
|
|
|
expect(linesWithReferences[1].meta_data.new_pos).toEqual(11);
|
|
|
|
});
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|
2018-07-05 08:05:57 -04:00
|
|
|
|
|
|
|
describe('trimFirstCharOfLineContent', () => {
|
|
|
|
it('trims the line when it starts with a space', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(utils.trimFirstCharOfLineContent({ rich_text: ' diff' })).toEqual({
|
|
|
|
rich_text: 'diff',
|
2018-09-02 06:44:51 -04:00
|
|
|
});
|
2018-07-05 08:05:57 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('trims the line when it starts with a +', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(utils.trimFirstCharOfLineContent({ rich_text: '+diff' })).toEqual({
|
|
|
|
rich_text: 'diff',
|
2018-09-02 06:44:51 -04:00
|
|
|
});
|
2018-07-05 08:05:57 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('trims the line when it starts with a -', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(utils.trimFirstCharOfLineContent({ rich_text: '-diff' })).toEqual({
|
|
|
|
rich_text: 'diff',
|
2018-09-02 06:44:51 -04:00
|
|
|
});
|
2018-07-05 08:05:57 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('does not trims the line when it starts with a letter', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(utils.trimFirstCharOfLineContent({ rich_text: 'diff' })).toEqual({
|
|
|
|
rich_text: 'diff',
|
2018-09-02 06:44:51 -04:00
|
|
|
});
|
2018-07-05 08:05:57 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('does not modify the provided object', () => {
|
|
|
|
const lineObj = {
|
2018-11-09 14:48:41 -05:00
|
|
|
rich_text: ' diff',
|
2018-07-05 08:05:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
utils.trimFirstCharOfLineContent(lineObj);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2019-01-22 07:35:28 -05:00
|
|
|
expect(lineObj).toEqual({ rich_text: ' diff' });
|
2018-07-05 08:05:57 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('handles a undefined or null parameter', () => {
|
2019-01-22 07:35:28 -05:00
|
|
|
expect(utils.trimFirstCharOfLineContent()).toEqual({});
|
2018-07-05 08:05:57 -04:00
|
|
|
});
|
|
|
|
});
|
2018-09-06 19:27:21 -04:00
|
|
|
|
|
|
|
describe('prepareDiffData', () => {
|
2020-01-14 07:07:41 -05:00
|
|
|
let mock;
|
2018-12-17 20:25:41 -05:00
|
|
|
let preparedDiff;
|
2020-01-14 07:07:41 -05:00
|
|
|
let splitInlineDiff;
|
|
|
|
let splitParallelDiff;
|
|
|
|
let completedDiff;
|
2018-12-17 20:25:41 -05:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2020-01-14 07:07:41 -05:00
|
|
|
mock = getDiffFileMock();
|
|
|
|
preparedDiff = { diff_files: [mock] };
|
|
|
|
splitInlineDiff = {
|
|
|
|
diff_files: [Object.assign({}, mock, { parallel_diff_lines: undefined })],
|
|
|
|
};
|
|
|
|
splitParallelDiff = {
|
|
|
|
diff_files: [Object.assign({}, mock, { highlighted_diff_lines: undefined })],
|
|
|
|
};
|
|
|
|
completedDiff = {
|
|
|
|
diff_files: [Object.assign({}, mock, { highlighted_diff_lines: undefined })],
|
|
|
|
};
|
|
|
|
|
2020-02-12 19:08:46 -05:00
|
|
|
preparedDiff.diff_files = utils.prepareDiffData(preparedDiff);
|
|
|
|
splitInlineDiff.diff_files = utils.prepareDiffData(splitInlineDiff);
|
|
|
|
splitParallelDiff.diff_files = utils.prepareDiffData(splitParallelDiff);
|
|
|
|
completedDiff.diff_files = utils.prepareDiffData(completedDiff, [mock]);
|
2018-12-17 20:25:41 -05:00
|
|
|
});
|
2018-09-06 19:27:21 -04:00
|
|
|
|
2018-12-17 20:25:41 -05:00
|
|
|
it('sets the renderIt and collapsed attribute on files', () => {
|
2018-11-09 14:48:41 -05:00
|
|
|
const firstParallelDiffLine = preparedDiff.diff_files[0].parallel_diff_lines[2];
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2018-09-06 19:27:21 -04:00
|
|
|
expect(firstParallelDiffLine.left.discussions.length).toBe(0);
|
|
|
|
expect(firstParallelDiffLine.left).not.toHaveAttr('text');
|
|
|
|
expect(firstParallelDiffLine.right.discussions.length).toBe(0);
|
|
|
|
expect(firstParallelDiffLine.right).not.toHaveAttr('text');
|
2018-11-09 14:48:41 -05:00
|
|
|
const firstParallelChar = firstParallelDiffLine.right.rich_text.charAt(0);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2018-09-10 04:50:41 -04:00
|
|
|
expect(firstParallelChar).not.toBe(' ');
|
|
|
|
expect(firstParallelChar).not.toBe('+');
|
|
|
|
expect(firstParallelChar).not.toBe('-');
|
|
|
|
|
2018-11-09 14:48:41 -05:00
|
|
|
const checkLine = preparedDiff.diff_files[0].highlighted_diff_lines[0];
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2018-09-10 04:50:41 -04:00
|
|
|
expect(checkLine.discussions.length).toBe(0);
|
|
|
|
expect(checkLine).not.toHaveAttr('text');
|
2018-11-09 14:48:41 -05:00
|
|
|
const firstChar = checkLine.rich_text.charAt(0);
|
2018-10-09 14:03:09 -04:00
|
|
|
|
2018-09-10 04:50:41 -04:00
|
|
|
expect(firstChar).not.toBe(' ');
|
|
|
|
expect(firstChar).not.toBe('+');
|
|
|
|
expect(firstChar).not.toBe('-');
|
2018-09-06 19:27:21 -04:00
|
|
|
|
2018-11-09 14:48:41 -05:00
|
|
|
expect(preparedDiff.diff_files[0].renderIt).toBeTruthy();
|
|
|
|
expect(preparedDiff.diff_files[0].collapsed).toBeFalsy();
|
2018-09-06 19:27:21 -04:00
|
|
|
});
|
2018-12-17 20:25:41 -05:00
|
|
|
|
|
|
|
it('adds line_code to all lines', () => {
|
|
|
|
expect(
|
|
|
|
preparedDiff.diff_files[0].parallel_diff_lines.filter(line => !line.line_code),
|
|
|
|
).toHaveLength(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('uses right line code if left has none', () => {
|
|
|
|
const firstLine = preparedDiff.diff_files[0].parallel_diff_lines[0];
|
|
|
|
|
|
|
|
expect(firstLine.line_code).toEqual(firstLine.right.line_code);
|
|
|
|
});
|
2020-01-14 07:07:41 -05:00
|
|
|
|
|
|
|
it('guarantees an empty array for both diff styles', () => {
|
|
|
|
expect(splitInlineDiff.diff_files[0].parallel_diff_lines.length).toEqual(0);
|
|
|
|
expect(splitInlineDiff.diff_files[0].highlighted_diff_lines.length).toBeGreaterThan(0);
|
|
|
|
expect(splitParallelDiff.diff_files[0].parallel_diff_lines.length).toBeGreaterThan(0);
|
|
|
|
expect(splitParallelDiff.diff_files[0].highlighted_diff_lines.length).toEqual(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('merges existing diff files with newly loaded diff files to ensure split diffs are eventually completed', () => {
|
|
|
|
expect(completedDiff.diff_files.length).toEqual(1);
|
|
|
|
expect(completedDiff.diff_files[0].parallel_diff_lines.length).toBeGreaterThan(0);
|
|
|
|
expect(completedDiff.diff_files[0].highlighted_diff_lines.length).toBeGreaterThan(0);
|
|
|
|
});
|
2020-02-12 19:08:46 -05:00
|
|
|
|
|
|
|
it('leaves files in the existing state', () => {
|
|
|
|
const priorFiles = [mock];
|
|
|
|
const fakeNewFile = {
|
|
|
|
...mock,
|
|
|
|
content_sha: 'ABC',
|
|
|
|
file_hash: 'DEF',
|
|
|
|
};
|
|
|
|
const updatedFilesList = utils.prepareDiffData({ diff_files: [fakeNewFile] }, priorFiles);
|
|
|
|
|
|
|
|
expect(updatedFilesList).toEqual([mock, fakeNewFile]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('completes an existing split diff without overwriting existing diffs', () => {
|
|
|
|
// The current state has a file that has only loaded inline lines
|
|
|
|
const priorFiles = [{ ...mock, parallel_diff_lines: [] }];
|
|
|
|
// The next (batch) load loads two files: the other half of that file, and a new file
|
|
|
|
const fakeBatch = [
|
|
|
|
{ ...mock, highlighted_diff_lines: undefined },
|
|
|
|
{ ...mock, highlighted_diff_lines: undefined, content_sha: 'ABC', file_hash: 'DEF' },
|
|
|
|
];
|
|
|
|
const updatedFilesList = utils.prepareDiffData({ diff_files: fakeBatch }, priorFiles);
|
|
|
|
|
|
|
|
expect(updatedFilesList).toEqual([
|
|
|
|
mock,
|
|
|
|
jasmine.objectContaining({
|
|
|
|
content_sha: 'ABC',
|
|
|
|
file_hash: 'DEF',
|
|
|
|
}),
|
|
|
|
]);
|
|
|
|
});
|
2018-09-06 19:27:21 -04:00
|
|
|
});
|
2018-09-08 02:37:41 -04:00
|
|
|
|
|
|
|
describe('isDiscussionApplicableToLine', () => {
|
|
|
|
const diffPosition = {
|
|
|
|
baseSha: 'ed13df29948c41ba367caa757ab3ec4892509910',
|
|
|
|
headSha: 'b921914f9a834ac47e6fd9420f78db0f83559130',
|
|
|
|
newLine: null,
|
|
|
|
newPath: '500-lines-4.txt',
|
|
|
|
oldLine: 5,
|
|
|
|
oldPath: '500-lines-4.txt',
|
|
|
|
startSha: 'ed13df29948c41ba367caa757ab3ec4892509910',
|
|
|
|
};
|
|
|
|
|
|
|
|
const wrongDiffPosition = {
|
|
|
|
baseSha: 'wrong',
|
|
|
|
headSha: 'wrong',
|
|
|
|
newLine: null,
|
|
|
|
newPath: '500-lines-4.txt',
|
|
|
|
oldLine: 5,
|
|
|
|
oldPath: '500-lines-4.txt',
|
|
|
|
startSha: 'wrong',
|
|
|
|
};
|
|
|
|
|
|
|
|
const discussions = {
|
|
|
|
upToDateDiscussion1: {
|
2018-09-28 05:54:32 -04:00
|
|
|
original_position: diffPosition,
|
|
|
|
position: wrongDiffPosition,
|
2018-09-08 02:37:41 -04:00
|
|
|
},
|
|
|
|
outDatedDiscussion1: {
|
2018-09-28 05:54:32 -04:00
|
|
|
original_position: wrongDiffPosition,
|
|
|
|
position: wrongDiffPosition,
|
2018-09-08 02:37:41 -04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
it('returns true when the discussion is up to date', () => {
|
|
|
|
expect(
|
2018-09-18 11:27:53 -04:00
|
|
|
utils.isDiscussionApplicableToLine({
|
|
|
|
discussion: discussions.upToDateDiscussion1,
|
|
|
|
diffPosition,
|
|
|
|
latestDiff: true,
|
|
|
|
}),
|
2018-09-08 02:37:41 -04:00
|
|
|
).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns false when the discussion is not up to date', () => {
|
|
|
|
expect(
|
2018-09-18 11:27:53 -04:00
|
|
|
utils.isDiscussionApplicableToLine({
|
|
|
|
discussion: discussions.outDatedDiscussion1,
|
|
|
|
diffPosition,
|
|
|
|
latestDiff: true,
|
|
|
|
}),
|
2018-09-08 02:37:41 -04:00
|
|
|
).toBe(false);
|
|
|
|
});
|
2018-09-11 04:35:00 -04:00
|
|
|
|
2018-09-14 05:17:31 -04:00
|
|
|
it('returns true when line codes match and discussion does not contain position and is not active', () => {
|
|
|
|
const discussion = { ...discussions.outDatedDiscussion1, line_code: 'ABC_1', active: false };
|
|
|
|
delete discussion.original_position;
|
|
|
|
delete discussion.position;
|
|
|
|
|
|
|
|
expect(
|
2018-09-18 11:27:53 -04:00
|
|
|
utils.isDiscussionApplicableToLine({
|
2018-09-17 05:49:41 -04:00
|
|
|
discussion,
|
2018-09-18 11:27:53 -04:00
|
|
|
diffPosition: {
|
2018-09-17 05:49:41 -04:00
|
|
|
...diffPosition,
|
|
|
|
lineCode: 'ABC_1',
|
|
|
|
},
|
2018-09-18 11:27:53 -04:00
|
|
|
latestDiff: true,
|
|
|
|
}),
|
2018-09-14 05:17:31 -04:00
|
|
|
).toBe(false);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns true when line codes match and discussion does not contain position and is active', () => {
|
|
|
|
const discussion = { ...discussions.outDatedDiscussion1, line_code: 'ABC_1', active: true };
|
2018-09-11 04:35:00 -04:00
|
|
|
delete discussion.original_position;
|
|
|
|
delete discussion.position;
|
|
|
|
|
|
|
|
expect(
|
2018-09-18 11:27:53 -04:00
|
|
|
utils.isDiscussionApplicableToLine({
|
2018-09-17 05:49:41 -04:00
|
|
|
discussion,
|
2018-09-18 11:27:53 -04:00
|
|
|
diffPosition: {
|
2018-09-17 05:49:41 -04:00
|
|
|
...diffPosition,
|
2018-11-09 14:48:41 -05:00
|
|
|
line_code: 'ABC_1',
|
2018-09-17 05:49:41 -04:00
|
|
|
},
|
2018-09-18 11:27:53 -04:00
|
|
|
latestDiff: true,
|
|
|
|
}),
|
2018-09-11 04:35:00 -04:00
|
|
|
).toBe(true);
|
|
|
|
});
|
2018-09-17 05:49:41 -04:00
|
|
|
|
|
|
|
it('returns false when not latest diff', () => {
|
|
|
|
const discussion = { ...discussions.outDatedDiscussion1, line_code: 'ABC_1', active: true };
|
|
|
|
delete discussion.original_position;
|
|
|
|
delete discussion.position;
|
|
|
|
|
|
|
|
expect(
|
2018-09-18 11:27:53 -04:00
|
|
|
utils.isDiscussionApplicableToLine({
|
2018-09-17 05:49:41 -04:00
|
|
|
discussion,
|
2018-09-18 11:27:53 -04:00
|
|
|
diffPosition: {
|
2018-09-17 05:49:41 -04:00
|
|
|
...diffPosition,
|
|
|
|
lineCode: 'ABC_1',
|
|
|
|
},
|
2018-09-18 11:27:53 -04:00
|
|
|
latestDiff: false,
|
|
|
|
}),
|
2018-09-17 05:49:41 -04:00
|
|
|
).toBe(false);
|
|
|
|
});
|
2018-09-08 02:37:41 -04:00
|
|
|
});
|
2018-10-03 05:05:43 -04:00
|
|
|
|
|
|
|
describe('generateTreeList', () => {
|
|
|
|
let files;
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
files = [
|
|
|
|
{
|
2018-11-09 14:48:41 -05:00
|
|
|
new_path: 'app/index.js',
|
|
|
|
deleted_file: false,
|
|
|
|
new_file: false,
|
|
|
|
removed_lines: 10,
|
|
|
|
added_lines: 0,
|
|
|
|
file_hash: 'test',
|
2018-10-03 05:05:43 -04:00
|
|
|
},
|
|
|
|
{
|
2018-11-09 14:48:41 -05:00
|
|
|
new_path: 'app/test/index.js',
|
|
|
|
deleted_file: false,
|
|
|
|
new_file: true,
|
|
|
|
removed_lines: 0,
|
|
|
|
added_lines: 0,
|
|
|
|
file_hash: 'test',
|
2018-10-03 05:05:43 -04:00
|
|
|
},
|
2018-10-08 06:50:22 -04:00
|
|
|
{
|
2018-11-09 14:48:41 -05:00
|
|
|
new_path: 'app/test/filepathneedstruncating.js',
|
|
|
|
deleted_file: false,
|
|
|
|
new_file: true,
|
|
|
|
removed_lines: 0,
|
|
|
|
added_lines: 0,
|
|
|
|
file_hash: 'test',
|
2018-10-08 06:50:22 -04:00
|
|
|
},
|
2018-10-03 05:05:43 -04:00
|
|
|
{
|
2018-11-09 14:48:41 -05:00
|
|
|
new_path: 'package.json',
|
|
|
|
deleted_file: true,
|
|
|
|
new_file: false,
|
|
|
|
removed_lines: 0,
|
|
|
|
added_lines: 0,
|
|
|
|
file_hash: 'test',
|
2018-10-03 05:05:43 -04:00
|
|
|
},
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
it('creates a tree of files', () => {
|
|
|
|
const { tree } = utils.generateTreeList(files);
|
|
|
|
|
|
|
|
expect(tree).toEqual([
|
|
|
|
{
|
|
|
|
key: 'app',
|
|
|
|
path: 'app',
|
|
|
|
name: 'app',
|
|
|
|
type: 'tree',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
addedLines: 0,
|
|
|
|
changed: true,
|
|
|
|
deleted: false,
|
|
|
|
fileHash: 'test',
|
|
|
|
key: 'app/index.js',
|
|
|
|
name: 'index.js',
|
2019-01-08 04:31:23 -05:00
|
|
|
parentPath: 'app/',
|
2018-10-03 05:05:43 -04:00
|
|
|
path: 'app/index.js',
|
|
|
|
removedLines: 10,
|
|
|
|
tempFile: false,
|
|
|
|
type: 'blob',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'app/test',
|
|
|
|
path: 'app/test',
|
|
|
|
name: 'test',
|
|
|
|
type: 'tree',
|
|
|
|
opened: true,
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
addedLines: 0,
|
|
|
|
changed: true,
|
|
|
|
deleted: false,
|
|
|
|
fileHash: 'test',
|
|
|
|
key: 'app/test/index.js',
|
|
|
|
name: 'index.js',
|
2019-01-08 04:31:23 -05:00
|
|
|
parentPath: 'app/test/',
|
2018-10-03 05:05:43 -04:00
|
|
|
path: 'app/test/index.js',
|
2018-10-08 06:50:22 -04:00
|
|
|
removedLines: 0,
|
|
|
|
tempFile: true,
|
|
|
|
type: 'blob',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
addedLines: 0,
|
|
|
|
changed: true,
|
|
|
|
deleted: false,
|
|
|
|
fileHash: 'test',
|
|
|
|
key: 'app/test/filepathneedstruncating.js',
|
|
|
|
name: 'filepathneedstruncating.js',
|
2019-01-08 04:31:23 -05:00
|
|
|
parentPath: 'app/test/',
|
2018-10-08 06:50:22 -04:00
|
|
|
path: 'app/test/filepathneedstruncating.js',
|
2018-10-03 05:05:43 -04:00
|
|
|
removedLines: 0,
|
|
|
|
tempFile: true,
|
|
|
|
type: 'blob',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
opened: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'package.json',
|
2019-01-08 04:31:23 -05:00
|
|
|
parentPath: '/',
|
2018-10-03 05:05:43 -04:00
|
|
|
path: 'package.json',
|
|
|
|
name: 'package.json',
|
|
|
|
type: 'blob',
|
|
|
|
changed: true,
|
|
|
|
tempFile: false,
|
|
|
|
deleted: true,
|
|
|
|
fileHash: 'test',
|
|
|
|
addedLines: 0,
|
|
|
|
removedLines: 0,
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('creates flat list of blobs & folders', () => {
|
|
|
|
const { treeEntries } = utils.generateTreeList(files);
|
|
|
|
|
|
|
|
expect(Object.keys(treeEntries)).toEqual([
|
|
|
|
'app',
|
|
|
|
'app/index.js',
|
|
|
|
'app/test',
|
|
|
|
'app/test/index.js',
|
2018-10-08 06:50:22 -04:00
|
|
|
'app/test/filepathneedstruncating.js',
|
2018-10-03 05:05:43 -04:00
|
|
|
'package.json',
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
2018-12-06 09:39:29 -05:00
|
|
|
|
|
|
|
describe('getDiffMode', () => {
|
|
|
|
it('returns mode when matched in file', () => {
|
|
|
|
expect(
|
|
|
|
utils.getDiffMode({
|
|
|
|
renamed_file: true,
|
|
|
|
}),
|
|
|
|
).toBe('renamed');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns mode_changed if key has no match', () => {
|
|
|
|
expect(
|
|
|
|
utils.getDiffMode({
|
2019-02-15 12:56:50 -05:00
|
|
|
viewer: { name: 'mode_changed' },
|
2018-12-06 09:39:29 -05:00
|
|
|
}),
|
|
|
|
).toBe('mode_changed');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('defaults to replaced', () => {
|
|
|
|
expect(utils.getDiffMode({})).toBe('replaced');
|
|
|
|
});
|
|
|
|
});
|
2019-01-16 12:24:05 -05:00
|
|
|
|
|
|
|
describe('getLowestSingleFolder', () => {
|
|
|
|
it('returns path and tree of lowest single folder tree', () => {
|
|
|
|
const folder = {
|
|
|
|
name: 'app',
|
|
|
|
type: 'tree',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
name: 'javascripts',
|
|
|
|
type: 'tree',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'index.js',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
const { path, treeAcc } = utils.getLowestSingleFolder(folder);
|
|
|
|
|
|
|
|
expect(path).toEqual('app/javascripts');
|
|
|
|
expect(treeAcc).toEqual([
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'index.js',
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns passed in folders path & tree when more than tree exists', () => {
|
|
|
|
const folder = {
|
|
|
|
name: 'app',
|
|
|
|
type: 'tree',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
name: 'spec',
|
|
|
|
type: 'blob',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
const { path, treeAcc } = utils.getLowestSingleFolder(folder);
|
|
|
|
|
|
|
|
expect(path).toEqual('app');
|
|
|
|
expect(treeAcc).toBeNull();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('flattenTree', () => {
|
|
|
|
it('returns flattened directory structure', () => {
|
|
|
|
const tree = [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'app',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'javascripts',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'index.js',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-01-24 11:14:14 -05:00
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'ee',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'lib',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'ee',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'gitlab',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'checks',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'longtreenametomakepath',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'diff_check.rb',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-01-16 12:24:05 -05:00
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'spec',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'javascripts',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'index_spec.js',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
const flattened = utils.flattenTree(tree);
|
|
|
|
|
|
|
|
expect(flattened).toEqual([
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'app/javascripts',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'index.js',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-01-24 11:14:14 -05:00
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'ee/lib/…/…/…/longtreenametomakepath',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
name: 'diff_check.rb',
|
|
|
|
tree: [],
|
|
|
|
type: 'blob',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-01-16 12:24:05 -05:00
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'spec',
|
|
|
|
tree: [
|
|
|
|
{
|
|
|
|
type: 'tree',
|
|
|
|
name: 'javascripts',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'blob',
|
|
|
|
name: 'index_spec.js',
|
|
|
|
tree: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
2019-02-28 09:14:15 -05:00
|
|
|
|
|
|
|
describe('convertExpandLines', () => {
|
|
|
|
it('converts expanded lines to normal lines', () => {
|
|
|
|
const diffLines = [
|
|
|
|
{
|
|
|
|
type: 'match',
|
|
|
|
old_line: 1,
|
|
|
|
new_line: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: '',
|
|
|
|
old_line: 2,
|
|
|
|
new_line: 2,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const lines = utils.convertExpandLines({
|
|
|
|
diffLines,
|
|
|
|
data: [{ text: 'expanded' }],
|
|
|
|
typeKey: 'type',
|
|
|
|
oldLineKey: 'old_line',
|
|
|
|
newLineKey: 'new_line',
|
|
|
|
mapLine: ({ line, oldLine, newLine }) => ({
|
|
|
|
...line,
|
|
|
|
old_line: oldLine,
|
|
|
|
new_line: newLine,
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(lines).toEqual([
|
|
|
|
{
|
|
|
|
text: 'expanded',
|
|
|
|
new_line: 1,
|
|
|
|
old_line: 1,
|
|
|
|
discussions: [],
|
|
|
|
hasForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: '',
|
|
|
|
old_line: 2,
|
|
|
|
new_line: 2,
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
2018-06-21 08:22:40 -04:00
|
|
|
});
|