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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
3e9965f7
Commit
3e9965f7
authored
Aug 07, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for diff_file specs
parent
259e5440
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
spec/javascripts/diffs/components/diff_file_spec.js
spec/javascripts/diffs/components/diff_file_spec.js
+9
-1
spec/javascripts/diffs/mock_data/diff_file.js
spec/javascripts/diffs/mock_data/diff_file.js
+1
-0
No files found.
spec/javascripts/diffs/components/diff_file_spec.js
View file @
3e9965f7
...
...
@@ -22,11 +22,18 @@ describe('DiffFile', () => {
expect
(
el
.
id
).
toEqual
(
fileHash
);
expect
(
el
.
classList
.
contains
(
'
diff-file
'
)).
toEqual
(
true
);
expect
(
el
.
querySelectorAll
(
'
.diff-content.hidden
'
).
length
).
toEqual
(
0
);
expect
(
el
.
querySelector
(
'
.js-file-title
'
)).
toBeDefined
();
expect
(
el
.
querySelector
(
'
.file-title-name
'
).
innerText
.
indexOf
(
filePath
)
>
-
1
).
toEqual
(
true
);
expect
(
el
.
querySelector
(
'
.js-syntax-highlight
'
)).
toBeDefined
();
expect
(
el
.
querySelectorAll
(
'
.line_content
'
).
length
>
5
).
toEqual
(
true
);
expect
(
vm
.
file
.
renderIt
).
toEqual
(
false
);
vm
.
file
.
renderIt
=
true
;
vm
.
$nextTick
(()
=>
{
expect
(
el
.
querySelectorAll
(
'
.line_content
'
).
length
>
5
).
toEqual
(
true
);
});
});
describe
(
'
collapsed
'
,
()
=>
{
...
...
@@ -34,6 +41,7 @@ describe('DiffFile', () => {
expect
(
vm
.
$el
.
querySelectorAll
(
'
.diff-content
'
).
length
).
toEqual
(
1
);
expect
(
vm
.
file
.
collapsed
).
toEqual
(
false
);
vm
.
file
.
collapsed
=
true
;
vm
.
file
.
renderIt
=
true
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelectorAll
(
'
.diff-content
'
).
length
).
toEqual
(
0
);
...
...
spec/javascripts/diffs/mock_data/diff_file.js
View file @
3e9965f7
...
...
@@ -39,6 +39,7 @@ export default {
viewPath
:
'
/gitlab-org/gitlab-test/blob/spooky-stuff/CHANGELOG
'
,
replacedViewPath
:
null
,
collapsed
:
false
,
renderIt
:
false
,
tooLarge
:
false
,
contextLinesPath
:
'
/gitlab-org/gitlab-test/blob/c48ee0d1bf3b30453f5b32250ce03134beaa6d13/CHANGELOG/diff
'
,
...
...
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