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
ef22b0dc
Commit
ef22b0dc
authored
Sep 29, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Title has now its own test
parent
705a840d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
spec/javascripts/repo/components/repo_file_spec.js
spec/javascripts/repo/components/repo_file_spec.js
+11
-4
No files found.
spec/javascripts/repo/components/repo_file_spec.js
View file @
ef22b0dc
...
...
@@ -8,14 +8,17 @@ describe('RepoFile', () => {
icon
:
'
icon
'
,
url
:
'
url
'
,
name
:
'
name
'
,
pageTitle
:
'
pageTitle
'
,
lastCommitMessage
:
'
message
'
,
lastCommitUpdate
:
Date
.
now
(),
level
:
10
,
};
const
activeFile
=
{
url
:
'
activeUrl
'
,
pageTitle
:
'
pageTitle
'
,
url
:
'
url
'
,
};
const
otherFile
=
{
html
:
'
<p class="file-content">html</p>
'
,
pageTitle
:
'
otherpageTitle
'
,
};
function
createComponent
(
propsData
)
{
...
...
@@ -31,7 +34,6 @@ describe('RepoFile', () => {
});
it
(
'
renders link, icon, name and last commit details
'
,
()
=>
{
RepoStore
.
setActiveFiles
(
activeFile
);
const
vm
=
createComponent
({
file
,
activeFile
,
...
...
@@ -44,7 +46,6 @@ describe('RepoFile', () => {
expect
(
name
.
title
).
toEqual
(
file
.
url
);
expect
(
name
.
href
).
toMatch
(
`/
${
file
.
url
}
`
);
expect
(
name
.
textContent
.
trim
()).
toEqual
(
file
.
name
);
expect
(
document
.
title
.
trim
()).
toEqual
(
activeFile
.
pageTitle
);
expect
(
vm
.
$el
.
querySelector
(
'
.commit-message
'
).
textContent
.
trim
()).
toBe
(
file
.
lastCommitMessage
);
expect
(
vm
.
$el
.
querySelector
(
'
.commit-update
'
).
textContent
.
trim
()).
toBe
(
updated
);
expect
(
fileIcon
.
classList
.
contains
(
file
.
icon
)).
toBeTruthy
();
...
...
@@ -65,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
({
...
...
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