Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-21 09:08:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-21 09:08:58 +0300
commit18b8435318887d3fc6e9f9d305967a953cdd7d3f (patch)
tree28cb71f255eb364c224ff24dd085f8cd836951b1 /spec/frontend/repository
parent4359b9650ecf0960f04f0fd38fc25bec7b478a11 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/repository')
-rw-r--r--spec/frontend/repository/components/preview/index_spec.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/frontend/repository/components/preview/index_spec.js b/spec/frontend/repository/components/preview/index_spec.js
index 7587ca4186c..6ae323f5c3f 100644
--- a/spec/frontend/repository/components/preview/index_spec.js
+++ b/spec/frontend/repository/components/preview/index_spec.js
@@ -1,7 +1,10 @@
import { shallowMount } from '@vue/test-utils';
import { GlLoadingIcon } from '@gitlab/ui';
+import { handleLocationHash } from '~/lib/utils/common_utils';
import Preview from '~/repository/components/preview/index.vue';
+jest.mock('~/lib/utils/common_utils');
+
let vm;
let $apollo;
@@ -38,6 +41,22 @@ describe('Repository file preview component', () => {
});
});
+ it('handles hash after render', () => {
+ factory({
+ webUrl: 'http://test.com',
+ name: 'README.md',
+ });
+
+ vm.setData({ readme: { html: '<div class="blob">test</div>' } });
+
+ return vm.vm
+ .$nextTick()
+ .then(vm.vm.$nextTick())
+ .then(() => {
+ expect(handleLocationHash).toHaveBeenCalled();
+ });
+ });
+
it('renders loading icon', () => {
factory({
webUrl: 'http://test.com',