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
c65a8a6e
Commit
c65a8a6e
authored
May 30, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tests
parent
e53a0096
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
1 deletion
+64
-1
spec/javascripts/fixtures/raw.rb
spec/javascripts/fixtures/raw.rb
+6
-0
spec/javascripts/notebook/cells/markdown_spec.js
spec/javascripts/notebook/cells/markdown_spec.js
+57
-0
spec/support/test_env.rb
spec/support/test_env.rb
+1
-1
No files found.
spec/javascripts/fixtures/raw.rb
View file @
c65a8a6e
...
@@ -21,4 +21,10 @@ describe 'Raw files', '(JavaScript fixtures)', type: :controller do
...
@@ -21,4 +21,10 @@ describe 'Raw files', '(JavaScript fixtures)', type: :controller do
store_frontend_fixture
(
blob
.
data
,
example
.
description
)
store_frontend_fixture
(
blob
.
data
,
example
.
description
)
end
end
it
'blob/notebook/math.json'
do
|
example
|
blob
=
project
.
repository
.
blob_at
(
'93ee732'
,
'files/ipython/math.ipynb'
)
store_frontend_fixture
(
blob
.
data
,
example
.
description
)
end
end
end
spec/javascripts/notebook/cells/markdown_spec.js
View file @
c65a8a6e
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MarkdownComponent
from
'
~/notebook/cells/markdown.vue
'
;
import
MarkdownComponent
from
'
~/notebook/cells/markdown.vue
'
;
import
katex
from
'
vendor/katex
'
;
const
Component
=
Vue
.
extend
(
MarkdownComponent
);
const
Component
=
Vue
.
extend
(
MarkdownComponent
);
window
.
katex
=
katex
;
describe
(
'
Markdown component
'
,
()
=>
{
describe
(
'
Markdown component
'
,
()
=>
{
let
vm
;
let
vm
;
let
cell
;
let
cell
;
...
@@ -38,4 +41,58 @@ describe('Markdown component', () => {
...
@@ -38,4 +41,58 @@ describe('Markdown component', () => {
it
(
'
renders the markdown HTML
'
,
()
=>
{
it
(
'
renders the markdown HTML
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.markdown h1
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.markdown h1
'
)).
not
.
toBeNull
();
});
});
describe
(
'
katex
'
,
()
=>
{
beforeEach
(()
=>
{
json
=
getJSONFixture
(
'
blob/notebook/math.json
'
);
});
it
(
'
renders multi-line katex
'
,
(
done
)
=>
{
vm
=
new
Component
({
propsData
:
{
cell
:
json
.
cells
[
0
],
},
}).
$mount
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.katex
'
),
).
not
.
toBeNull
();
done
();
});
});
it
(
'
renders inline katex
'
,
(
done
)
=>
{
vm
=
new
Component
({
propsData
:
{
cell
:
json
.
cells
[
1
],
},
}).
$mount
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
p:first-child .katex
'
),
).
not
.
toBeNull
();
done
();
});
});
it
(
'
renders multiple inline katex
'
,
(
done
)
=>
{
vm
=
new
Component
({
propsData
:
{
cell
:
json
.
cells
[
1
],
},
}).
$mount
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelectorAll
(
'
p:nth-child(2) .katex
'
).
length
,
).
toBe
(
4
);
done
();
});
});
});
});
});
spec/support/test_env.rb
View file @
c65a8a6e
...
@@ -40,7 +40,7 @@ module TestEnv
...
@@ -40,7 +40,7 @@ module TestEnv
'wip'
=>
'b9238ee'
,
'wip'
=>
'b9238ee'
,
'csv'
=>
'3dd0896'
,
'csv'
=>
'3dd0896'
,
'v1.1.0'
=>
'b83d6e3'
,
'v1.1.0'
=>
'b83d6e3'
,
'add-ipython-files'
=>
'
6d85bb6
'
,
'add-ipython-files'
=>
'
93ee732
'
,
'add-pdf-file'
=>
'e774ebd'
'add-pdf-file'
=>
'e774ebd'
}.
freeze
}.
freeze
...
...
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