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
Jérome Perrin
gitlab-ce
Commits
95658fb6
Commit
95658fb6
authored
Apr 26, 2017
by
Phil Hughes
Committed by
Douwe Maan
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing JS tests
parent
dc4726f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+1
-1
spec/javascripts/blob/viewer/index_spec.js
spec/javascripts/blob/viewer/index_spec.js
+7
-3
No files found.
app/assets/javascripts/blob/viewer/index.js
View file @
95658fb6
/* eslint-disable no-new */
/* global Flash */
export
default
class
BlobViewer
{
constructor
()
{
...
...
@@ -76,6 +75,7 @@ export default class BlobViewer {
url
,
dataType
:
'
JSON
'
,
})
.
fail
(()
=>
new
Flash
(
'
Error loading source view
'
))
.
done
((
data
)
=>
{
viewer
.
innerHTML
=
data
.
html
;
$
(
viewer
).
syntaxHighlight
();
...
...
spec/javascripts/blob/viewer/index_spec.js
View file @
95658fb6
/* eslint-disable no-new */
import
BlobViewer
from
'
~/blob/viewer/index
'
;
describe
(
'
Blob viewer
'
,
()
=>
{
f
describe
(
'
Blob viewer
'
,
()
=>
{
preloadFixtures
(
'
blob/show.html.raw
'
);
beforeEach
(()
=>
{
...
...
@@ -73,6 +73,10 @@ describe('Blob viewer', () => {
document
.
querySelector
(
'
.blob-viewer[data-type="simple"]
'
).
getAttribute
(
'
data-loaded
'
),
).
toBe
(
'
true
'
);
done
();
})
.
catch
(()
=>
{
fail
();
done
();
});
});
...
...
@@ -87,7 +91,7 @@ describe('Blob viewer', () => {
it
(
'
has tooltip when disabled
'
,
()
=>
{
expect
(
document
.
querySelector
(
'
.js-copy-blob-source-btn
'
).
getAttribute
(
'
data-original-title
'
),
).
toBe
(
'
Switch to the source
view to copy the source
to the clipboard
'
);
).
toBe
(
'
Switch to the source
to copy it
to the clipboard
'
);
});
it
(
'
enables after switching to simple view
'
,
(
done
)
=>
{
...
...
@@ -111,7 +115,7 @@ describe('Blob viewer', () => {
expect
(
document
.
querySelector
(
'
.js-copy-blob-source-btn
'
).
getAttribute
(
'
data-original-title
'
),
).
toBe
(
'
Copy to clipboard
'
);
).
toBe
(
'
Copy
source
to clipboard
'
);
done
();
});
...
...
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