From 85e494935a8726dc98bb19ffa584488420e5011e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 14 Jan 2020 15:07:55 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../repository/components/table/parent_row_spec.js | 10 +++++++++- spec/frontend/repository/components/table/row_spec.js | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'spec/frontend/repository') diff --git a/spec/frontend/repository/components/table/parent_row_spec.js b/spec/frontend/repository/components/table/parent_row_spec.js index 7020055271f..439c7ff080c 100644 --- a/spec/frontend/repository/components/table/parent_row_spec.js +++ b/spec/frontend/repository/components/table/parent_row_spec.js @@ -1,10 +1,11 @@ import { shallowMount, RouterLinkStub } from '@vue/test-utils'; +import { GlLoadingIcon } from '@gitlab/ui'; import ParentRow from '~/repository/components/table/parent_row.vue'; let vm; let $router; -function factory(path) { +function factory(path, loadingPath) { $router = { push: jest.fn(), }; @@ -13,6 +14,7 @@ function factory(path) { propsData: { commitRef: 'master', path, + loadingPath, }, stubs: { RouterLink: RouterLinkStub, @@ -61,4 +63,10 @@ describe('Repository parent row component', () => { path: '/tree/master/app', }); }); + + it('renders loading icon when loading parent', () => { + factory('app/assets', 'app'); + + expect(vm.find(GlLoadingIcon).exists()).toBe(true); + }); }); diff --git a/spec/frontend/repository/components/table/row_spec.js b/spec/frontend/repository/components/table/row_spec.js index 067bad0dab6..b60560366a6 100644 --- a/spec/frontend/repository/components/table/row_spec.js +++ b/spec/frontend/repository/components/table/row_spec.js @@ -1,5 +1,5 @@ import { shallowMount, RouterLinkStub } from '@vue/test-utils'; -import { GlBadge, GlLink } from '@gitlab/ui'; +import { GlBadge, GlLink, GlLoadingIcon } from '@gitlab/ui'; import { visitUrl } from '~/lib/utils/url_utility'; import TableRow from '~/repository/components/table/row.vue'; import Icon from '~/vue_shared/components/icon.vue'; @@ -198,4 +198,17 @@ describe('Repository table row component', () => { expect(vm.find(Icon).exists()).toBe(true); }); }); + + it('renders loading icon when path is loading', () => { + factory({ + id: '1', + sha: '1', + path: 'test', + type: 'tree', + currentPath: '/', + loadingPath: 'test', + }); + + expect(vm.find(GlLoadingIcon).exists()).toBe(true); + }); }); -- cgit v1.2.3