diff options
Diffstat (limited to 'spec/frontend/diffs/utils/tree_worker_utils_spec.js')
-rw-r--r-- | spec/frontend/diffs/utils/tree_worker_utils_spec.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/spec/frontend/diffs/utils/tree_worker_utils_spec.js b/spec/frontend/diffs/utils/tree_worker_utils_spec.js index 8113428f712..4df5fe75004 100644 --- a/spec/frontend/diffs/utils/tree_worker_utils_spec.js +++ b/spec/frontend/diffs/utils/tree_worker_utils_spec.js @@ -35,6 +35,23 @@ describe('~/diffs/utils/tree_worker_utils', () => { file_hash: 'test', }, { + new_path: 'constructor/test/aFile.js', + deleted_file: false, + new_file: true, + removed_lines: 0, + added_lines: 42, + file_hash: 'test', + }, + { + new_path: 'submodule @ abcdef123', + deleted_file: false, + new_file: true, + removed_lines: 0, + added_lines: 1, + submodule: true, + file_hash: 'test', + }, + { new_path: 'package.json', deleted_file: true, new_file: false, @@ -66,6 +83,7 @@ describe('~/diffs/utils/tree_worker_utils', () => { path: 'app/index.js', removedLines: 10, tempFile: false, + submodule: undefined, type: 'blob', tree: [], }, @@ -87,6 +105,7 @@ describe('~/diffs/utils/tree_worker_utils', () => { path: 'app/test/index.js', removedLines: 0, tempFile: true, + submodule: undefined, type: 'blob', tree: [], }, @@ -101,6 +120,7 @@ describe('~/diffs/utils/tree_worker_utils', () => { path: 'app/test/filepathneedstruncating.js', removedLines: 0, tempFile: true, + submodule: undefined, type: 'blob', tree: [], }, @@ -110,6 +130,45 @@ describe('~/diffs/utils/tree_worker_utils', () => { opened: true, }, { + key: 'constructor', + name: 'constructor/test', + opened: true, + path: 'constructor', + tree: [ + { + addedLines: 42, + changed: true, + deleted: false, + fileHash: 'test', + key: 'constructor/test/aFile.js', + name: 'aFile.js', + parentPath: 'constructor/test/', + path: 'constructor/test/aFile.js', + removedLines: 0, + submodule: undefined, + tempFile: true, + tree: [], + type: 'blob', + }, + ], + type: 'tree', + }, + { + key: 'submodule @ abcdef123', + parentPath: '/', + path: 'submodule @ abcdef123', + name: 'submodule @ abcdef123', + type: 'blob', + changed: true, + tempFile: true, + submodule: true, + deleted: false, + fileHash: 'test', + addedLines: 1, + removedLines: 0, + tree: [], + }, + { key: 'package.json', parentPath: '/', path: 'package.json', @@ -117,6 +176,7 @@ describe('~/diffs/utils/tree_worker_utils', () => { type: 'blob', changed: true, tempFile: false, + submodule: undefined, deleted: true, fileHash: 'test', addedLines: 0, @@ -135,6 +195,10 @@ describe('~/diffs/utils/tree_worker_utils', () => { 'app/test', 'app/test/index.js', 'app/test/filepathneedstruncating.js', + 'constructor', + 'constructor/test', + 'constructor/test/aFile.js', + 'submodule @ abcdef123', 'package.json', ]); }); |