diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-13 10:08:10 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-16 11:29:30 +0100 |
commit | b1b91aa0658d81107327884ca56f579cf6146078 (patch) | |
tree | 999ed5273e0b42aa6848b76bbfefc6acb39c85f5 /spec/javascripts | |
parent | 3a7623fc010832c337e0ba0eb8650d7f6fca3562 (diff) | |
download | gitlab-ce-b1b91aa0658d81107327884ca56f579cf6146078.tar.gz |
Refactored multi-file data structure
This moves away from storing in a single array just to render the table.
It now stores in a multi-dimensional array/object type where each entry
in the array can have its own tree. This makes storing the data for
future feature a little easier as there is only one way to store the
data.
Previously to insert a directory the code had to insert the directory
& then the file at the right point in the array. Now the directory
can be inserted anywhere & then a file can be quickly added into this
directory.
The rendering is still done with a single array, but this is handled
through underscore. Underscore takes the array & then goes through
each item to flatten it into one. It is done this way to save changing
the markup away from table, keeping it as a table keeps it semantically
correct.
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/repo/components/repo_file_options_spec.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/spec/javascripts/repo/components/repo_file_options_spec.js b/spec/javascripts/repo/components/repo_file_options_spec.js deleted file mode 100644 index 9759b4bf12d..00000000000 --- a/spec/javascripts/repo/components/repo_file_options_spec.js +++ /dev/null @@ -1,33 +0,0 @@ -import Vue from 'vue'; -import repoFileOptions from '~/repo/components/repo_file_options.vue'; - -describe('RepoFileOptions', () => { - const projectName = 'projectName'; - - function createComponent(propsData) { - const RepoFileOptions = Vue.extend(repoFileOptions); - - return new RepoFileOptions({ - propsData, - }).$mount(); - } - - it('renders the title and new file/folder buttons if isMini is true', () => { - const vm = createComponent({ - isMini: true, - projectName, - }); - - expect(vm.$el.classList.contains('repo-file-options')).toBeTruthy(); - expect(vm.$el.querySelector('.title').textContent).toEqual(projectName); - }); - - it('does not render if isMini is false', () => { - const vm = createComponent({ - isMini: false, - projectName, - }); - - expect(vm.$el.innerHTML).toBeFalsy(); - }); -}); |