diff options
author | Phil Hughes <me@iamphill.com> | 2019-01-08 12:31:23 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-01-08 12:31:23 +0300 |
commit | 12edecd002163e7dedff6fcdf10043b7d1967962 (patch) | |
tree | 45bd3c1eee15e911fd43733f1af77a10e4f0fc98 /spec/javascripts/diffs | |
parent | 1d2ef4c6557846eb531f4d0e80cf43dea99b037b (diff) |
Add headers to files in the tree list on merge requests
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54807
Diffstat (limited to 'spec/javascripts/diffs')
-rw-r--r-- | spec/javascripts/diffs/components/tree_list_spec.js | 5 | ||||
-rw-r--r-- | spec/javascripts/diffs/store/getters_spec.js | 17 | ||||
-rw-r--r-- | spec/javascripts/diffs/store/utils_spec.js | 4 |
3 files changed, 24 insertions, 2 deletions
diff --git a/spec/javascripts/diffs/components/tree_list_spec.js b/spec/javascripts/diffs/components/tree_list_spec.js index a0b380adfd6..0a903bb7519 100644 --- a/spec/javascripts/diffs/components/tree_list_spec.js +++ b/spec/javascripts/diffs/components/tree_list_spec.js @@ -26,6 +26,8 @@ describe('Diffs tree list component', () => { store.state.diffs.removedLines = 20; store.state.diffs.diffFiles.push('test'); + localStorage.removeItem('mr_diff_tree_list'); + vm = mountComponentWithStore(Component, { store }); }); @@ -57,6 +59,7 @@ describe('Diffs tree list component', () => { removedLines: 0, tempFile: true, type: 'blob', + parentPath: 'app', }, app: { key: 'app', @@ -121,7 +124,7 @@ describe('Diffs tree list component', () => { vm.renderTreeList = false; vm.$nextTick(() => { - expect(vm.$el.querySelector('.file-row').textContent).toContain('app/index.js'); + expect(vm.$el.querySelector('.file-row').textContent).toContain('index.js'); done(); }); diff --git a/spec/javascripts/diffs/store/getters_spec.js b/spec/javascripts/diffs/store/getters_spec.js index 582535e0a53..190ca1230ca 100644 --- a/spec/javascripts/diffs/store/getters_spec.js +++ b/spec/javascripts/diffs/store/getters_spec.js @@ -230,15 +230,30 @@ describe('Diffs Module Getters', () => { localState.treeEntries = { file: { type: 'blob', + path: 'file', + parentPath: '/', + tree: [], }, tree: { type: 'tree', + path: 'tree', + parentPath: '/', + tree: [], }, }; expect(getters.allBlobs(localState)).toEqual([ { - type: 'blob', + isHeader: true, + path: '/', + tree: [ + { + parentPath: '/', + path: 'file', + tree: [], + type: 'blob', + }, + ], }, ]); }); diff --git a/spec/javascripts/diffs/store/utils_spec.js b/spec/javascripts/diffs/store/utils_spec.js index 4268634d302..036b320b314 100644 --- a/spec/javascripts/diffs/store/utils_spec.js +++ b/spec/javascripts/diffs/store/utils_spec.js @@ -502,6 +502,7 @@ describe('DiffsStoreUtils', () => { fileHash: 'test', key: 'app/index.js', name: 'index.js', + parentPath: 'app/', path: 'app/index.js', removedLines: 10, tempFile: false, @@ -522,6 +523,7 @@ describe('DiffsStoreUtils', () => { fileHash: 'test', key: 'app/test/index.js', name: 'index.js', + parentPath: 'app/test/', path: 'app/test/index.js', removedLines: 0, tempFile: true, @@ -535,6 +537,7 @@ describe('DiffsStoreUtils', () => { fileHash: 'test', key: 'app/test/filepathneedstruncating.js', name: 'filepathneedstruncating.js', + parentPath: 'app/test/', path: 'app/test/filepathneedstruncating.js', removedLines: 0, tempFile: true, @@ -548,6 +551,7 @@ describe('DiffsStoreUtils', () => { }, { key: 'package.json', + parentPath: '/', path: 'package.json', name: 'package.json', type: 'blob', |