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:
authorJacob Schatz <jschatz@gitlab.com>2017-09-29 16:22:27 +0300
committerJacob Schatz <jschatz@gitlab.com>2017-09-29 16:22:27 +0300
commit5307844c9a2d90410933bf0a20c95cf7e1c9f417 (patch)
tree3fc07428a2e272375c1890af5cb1b87ece294497 /spec/javascripts
parent60e40007c5a5877092e2e8e5e42d87b3d8a213b8 (diff)
parentef22b0dc813b9e1579ac4f25de2eaf8bf66a8236 (diff)
Merge branch 'dm-json-page-title' into 'master'
Use backend-provided page title in repo editor Closes #36029 See merge request gitlab-org/gitlab-ce!13763
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/repo/components/repo_file_spec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/repo/components/repo_file_spec.js b/spec/javascripts/repo/components/repo_file_spec.js
index 518a2d25ecf..f15633bd8b9 100644
--- a/spec/javascripts/repo/components/repo_file_spec.js
+++ b/spec/javascripts/repo/components/repo_file_spec.js
@@ -1,5 +1,6 @@
import Vue from 'vue';
import repoFile from '~/repo/components/repo_file.vue';
+import RepoStore from '~/repo/stores/repo_store';
describe('RepoFile', () => {
const updated = 'updated';
@@ -12,8 +13,13 @@ describe('RepoFile', () => {
level: 10,
};
const activeFile = {
+ pageTitle: 'pageTitle',
url: 'url',
};
+ const otherFile = {
+ html: '<p class="file-content">html</p>',
+ pageTitle: 'otherpageTitle',
+ };
function createComponent(propsData) {
const RepoFile = Vue.extend(repoFile);
@@ -60,6 +66,12 @@ describe('RepoFile', () => {
expect(vm.$el.querySelector('.fa-spin.fa-spinner')).toBeFalsy();
});
+ it('sets the document title correctly', () => {
+ RepoStore.setActiveFiles(otherFile);
+
+ expect(document.title.trim()).toEqual(otherFile.pageTitle);
+ });
+
it('renders a spinner if the file is loading', () => {
file.loading = true;
const vm = createComponent({