Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0647484c
Commit
0647484c
authored
Sep 29, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Test for PageTitle / Removed Gitlab Part from TItle
parent
5adae3d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+1
-1
spec/javascripts/repo/components/repo_file_spec.js
spec/javascripts/repo/components/repo_file_spec.js
+5
-0
No files found.
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
0647484c
...
@@ -257,7 +257,7 @@ const RepoHelper = {
...
@@ -257,7 +257,7 @@ const RepoHelper = {
history
.
pushState
({
key
:
RepoHelper
.
key
},
''
,
url
);
history
.
pushState
({
key
:
RepoHelper
.
key
},
''
,
url
);
if
(
title
)
{
if
(
title
)
{
document
.
title
=
`
${
title
}
· GitLab
`
;
document
.
title
=
`
${
title
}
`
;
}
}
},
},
...
...
spec/javascripts/repo/components/repo_file_spec.js
View file @
0647484c
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
repoFile
from
'
~/repo/components/repo_file.vue
'
;
import
repoFile
from
'
~/repo/components/repo_file.vue
'
;
import
RepoStore
from
'
~/repo/stores/repo_store
'
;
describe
(
'
RepoFile
'
,
()
=>
{
describe
(
'
RepoFile
'
,
()
=>
{
const
updated
=
'
updated
'
;
const
updated
=
'
updated
'
;
...
@@ -7,12 +8,14 @@ describe('RepoFile', () => {
...
@@ -7,12 +8,14 @@ describe('RepoFile', () => {
icon
:
'
icon
'
,
icon
:
'
icon
'
,
url
:
'
url
'
,
url
:
'
url
'
,
name
:
'
name
'
,
name
:
'
name
'
,
pageTitle
:
'
pageTitle
'
,
lastCommitMessage
:
'
message
'
,
lastCommitMessage
:
'
message
'
,
lastCommitUpdate
:
Date
.
now
(),
lastCommitUpdate
:
Date
.
now
(),
level
:
10
,
level
:
10
,
};
};
const
activeFile
=
{
const
activeFile
=
{
url
:
'
url
'
,
url
:
'
url
'
,
pageTitle
:
'
pageTitle
'
,
};
};
function
createComponent
(
propsData
)
{
function
createComponent
(
propsData
)
{
...
@@ -32,6 +35,7 @@ describe('RepoFile', () => {
...
@@ -32,6 +35,7 @@ describe('RepoFile', () => {
file
,
file
,
activeFile
,
activeFile
,
});
});
RepoStore
.
setActiveFiles
(
activeFile
);
const
name
=
vm
.
$el
.
querySelector
(
'
.repo-file-name
'
);
const
name
=
vm
.
$el
.
querySelector
(
'
.repo-file-name
'
);
const
fileIcon
=
vm
.
$el
.
querySelector
(
'
.file-icon
'
);
const
fileIcon
=
vm
.
$el
.
querySelector
(
'
.file-icon
'
);
...
@@ -40,6 +44,7 @@ describe('RepoFile', () => {
...
@@ -40,6 +44,7 @@ describe('RepoFile', () => {
expect
(
name
.
title
).
toEqual
(
file
.
url
);
expect
(
name
.
title
).
toEqual
(
file
.
url
);
expect
(
name
.
href
).
toMatch
(
`/
${
file
.
url
}
`
);
expect
(
name
.
href
).
toMatch
(
`/
${
file
.
url
}
`
);
expect
(
name
.
textContent
.
trim
()).
toEqual
(
file
.
name
);
expect
(
name
.
textContent
.
trim
()).
toEqual
(
file
.
name
);
expect
(
document
.
title
.
trim
()).
toEqual
(
file
.
pageTitle
);
expect
(
vm
.
$el
.
querySelector
(
'
.commit-message
'
).
textContent
.
trim
()).
toBe
(
file
.
lastCommitMessage
);
expect
(
vm
.
$el
.
querySelector
(
'
.commit-message
'
).
textContent
.
trim
()).
toBe
(
file
.
lastCommitMessage
);
expect
(
vm
.
$el
.
querySelector
(
'
.commit-update
'
).
textContent
.
trim
()).
toBe
(
updated
);
expect
(
vm
.
$el
.
querySelector
(
'
.commit-update
'
).
textContent
.
trim
()).
toBe
(
updated
);
expect
(
fileIcon
.
classList
.
contains
(
file
.
icon
)).
toBeTruthy
();
expect
(
fileIcon
.
classList
.
contains
(
file
.
icon
)).
toBeTruthy
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment