diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-08-10 14:32:35 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-08-14 11:09:22 -0500 |
commit | 15f37411839ffede77f94887fba257168d3d60cb (patch) | |
tree | de78dba3602f75a88d9e7294d00f2955c0f4e71f | |
parent | a081a60d89af1f05a8f6f243e073a96e35b2b349 (diff) | |
download | gitlab-ce-15f37411839ffede77f94887fba257168d3d60cb.tar.gz |
Remove loading state from repo_tab
Fix
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12198#note_37143710
-rw-r--r-- | app/assets/javascripts/repo/components/repo_tab.vue | 11 | ||||
-rw-r--r-- | spec/javascripts/repo/components/repo_tab_spec.js | 20 |
2 files changed, 8 insertions, 23 deletions
diff --git a/app/assets/javascripts/repo/components/repo_tab.vue b/app/assets/javascripts/repo/components/repo_tab.vue index b6a9948f487..fc66a8ea953 100644 --- a/app/assets/javascripts/repo/components/repo_tab.vue +++ b/app/assets/javascripts/repo/components/repo_tab.vue @@ -41,7 +41,6 @@ export default RepoTab; <template> <li> <a - v-if="!tab.loading" href="#0" class="close" @click.prevent="xClicked(tab)" @@ -53,8 +52,12 @@ export default RepoTab; </i> </a> - <a href="#" class="repo-tab" v-if="!tab.loading" :title="tab.url" @click.prevent="tabClicked(tab)">{{tab.name}}</a> - - <i v-if="tab.loading" class="fa fa-spinner fa-spin"></i> + <a + href="#" + class="repo-tab" + :title="tab.url" + @click.prevent="tabClicked(tab)"> + {{tab.name}} + </a> </li> </template> diff --git a/spec/javascripts/repo/components/repo_tab_spec.js b/spec/javascripts/repo/components/repo_tab_spec.js index f3572804b4a..a3b2d5dea82 100644 --- a/spec/javascripts/repo/components/repo_tab_spec.js +++ b/spec/javascripts/repo/components/repo_tab_spec.js @@ -12,7 +12,6 @@ describe('RepoTab', () => { it('renders a close link and a name link', () => { const tab = { - loading: false, url: 'url', name: 'name', }; @@ -26,7 +25,7 @@ describe('RepoTab', () => { spyOn(vm, 'tabClicked'); expect(close.querySelector('.fa-times')).toBeTruthy(); - expect(name.textContent).toEqual(tab.name); + expect(name.textContent.trim()).toEqual(tab.name); close.click(); name.click(); @@ -35,25 +34,8 @@ describe('RepoTab', () => { expect(vm.tabClicked).toHaveBeenCalledWith(tab); }); - it('renders a spinner if tab is loading', () => { - const tab = { - loading: true, - url: 'url', - }; - const vm = createComponent({ - tab, - }); - const close = vm.$el.querySelector('.close'); - const name = vm.$el.querySelector(`a[title="${tab.url}"]`); - - expect(close).toBeFalsy(); - expect(name).toBeFalsy(); - expect(vm.$el.querySelector('.fa.fa-spinner.fa-spin')).toBeTruthy(); - }); - it('renders an fa-circle icon if tab is changed', () => { const tab = { - loading: false, url: 'url', name: 'name', changed: true, |