summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Kipling <nkipling@gitlab.com>2019-08-16 09:51:28 +0100
committerNick Kipling <nkipling@gitlab.com>2019-08-16 09:51:28 +0100
commit01066ed3307ceee72ddbb2ac9a8bc7196668d237 (patch)
tree3f92e1fd12a672a218c9e4d7befe9d8c7af03927
parent6228a84895848ee46c819a821f02e026ec23c43f (diff)
downloadgitlab-ce-01066ed3307ceee72ddbb2ac9a8bc7196668d237.tar.gz
Changed view logic and simplified test selectors
-rw-r--r--app/assets/javascripts/registry/components/app.vue10
-rw-r--r--spec/javascripts/registry/components/app_spec.js7
2 files changed, 7 insertions, 10 deletions
diff --git a/app/assets/javascripts/registry/components/app.vue b/app/assets/javascripts/registry/components/app.vue
index 243e5282bb8..2f349c19f65 100644
--- a/app/assets/javascripts/registry/components/app.vue
+++ b/app/assets/javascripts/registry/components/app.vue
@@ -92,7 +92,9 @@ export default {
this.setMainEndpoint(this.endpoint);
},
mounted() {
- this.fetchRepos();
+ if (!this.characterError) {
+ this.fetchRepos();
+ }
},
methods: {
...mapActions(['setMainEndpoint', 'fetchRepos']),
@@ -111,16 +113,16 @@ export default {
</template>
</gl-empty-state>
- <gl-loading-icon v-else-if="isLoading && !characterError" size="md" class="prepend-top-16" />
+ <gl-loading-icon v-else-if="isLoading" size="md" class="prepend-top-16" />
- <div v-else-if="!isLoading && !characterError && repos.length">
+ <div v-else-if="!isLoading && repos.length">
<h4>{{ s__('ContainerRegistry|Container Registry') }}</h4>
<p v-html="introText"></p>
<collapsible-container v-for="item in repos" :key="item.id" :repo="item" />
</div>
<gl-empty-state
- v-else-if="!isLoading && !characterError && !repos.length"
+ v-else
:title="s__('ContainerRegistry|There are no container images stored for this project')"
:svg-path="noContainersImage"
class="container-message"
diff --git a/spec/javascripts/registry/components/app_spec.js b/spec/javascripts/registry/components/app_spec.js
index 5ed4654675f..1808b8558ba 100644
--- a/spec/javascripts/registry/components/app_spec.js
+++ b/spec/javascripts/registry/components/app_spec.js
@@ -84,12 +84,7 @@ describe('Registry List', () => {
it('should render empty message', done => {
setTimeout(() => {
- expect(
- vm.$el
- .querySelector('p')
- .textContent.trim()
- .replace(/[\r\n]+/g, ' '),
- ).toContain(
+ expect(vm.$el.querySelector('p > p').textContent).toEqual(
'With the Container Registry, every project can have its own space to store its Docker images. More Information',
);
done();