Commit 15f37411 authored by Eric Eastwood's avatar Eric Eastwood
parent a081a60d
...@@ -41,7 +41,6 @@ export default RepoTab; ...@@ -41,7 +41,6 @@ export default RepoTab;
<template> <template>
<li> <li>
<a <a
v-if="!tab.loading"
href="#0" href="#0"
class="close" class="close"
@click.prevent="xClicked(tab)" @click.prevent="xClicked(tab)"
...@@ -53,8 +52,12 @@ export default RepoTab; ...@@ -53,8 +52,12 @@ export default RepoTab;
</i> </i>
</a> </a>
<a href="#" class="repo-tab" v-if="!tab.loading" :title="tab.url" @click.prevent="tabClicked(tab)">{{tab.name}}</a> <a
href="#"
<i v-if="tab.loading" class="fa fa-spinner fa-spin"></i> class="repo-tab"
:title="tab.url"
@click.prevent="tabClicked(tab)">
{{tab.name}}
</a>
</li> </li>
</template> </template>
...@@ -12,7 +12,6 @@ describe('RepoTab', () => { ...@@ -12,7 +12,6 @@ describe('RepoTab', () => {
it('renders a close link and a name link', () => { it('renders a close link and a name link', () => {
const tab = { const tab = {
loading: false,
url: 'url', url: 'url',
name: 'name', name: 'name',
}; };
...@@ -26,7 +25,7 @@ describe('RepoTab', () => { ...@@ -26,7 +25,7 @@ describe('RepoTab', () => {
spyOn(vm, 'tabClicked'); spyOn(vm, 'tabClicked');
expect(close.querySelector('.fa-times')).toBeTruthy(); expect(close.querySelector('.fa-times')).toBeTruthy();
expect(name.textContent).toEqual(tab.name); expect(name.textContent.trim()).toEqual(tab.name);
close.click(); close.click();
name.click(); name.click();
...@@ -35,25 +34,8 @@ describe('RepoTab', () => { ...@@ -35,25 +34,8 @@ describe('RepoTab', () => {
expect(vm.tabClicked).toHaveBeenCalledWith(tab); 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', () => { it('renders an fa-circle icon if tab is changed', () => {
const tab = { const tab = {
loading: false,
url: 'url', url: 'url',
name: 'name', name: 'name',
changed: true, changed: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment