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
e187edc8
Commit
e187edc8
authored
Jul 19, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index spec
parent
1f494bcd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
spec/javascripts/repo/index_spec.js
spec/javascripts/repo/index_spec.js
+45
-0
No files found.
spec/javascripts/repo/index_spec.js
0 → 100644
View file @
e187edc8
import
Tabs
from
'
~/repo/repo_tabs
'
;
import
Sidebar
from
'
~/repo/repo_sidebar
'
;
import
Editor
from
'
~/repo/repo_editor
'
;
import
FileButtons
from
'
~/repo/repo_file_buttons
'
;
import
EditButton
from
'
~/repo/repo_edit_button
'
;
import
BinaryViewer
from
'
~/repo/repo_binary_viewer
'
;
import
CommitSection
from
'
~/repo/repo_commit_section
'
;
import
Service
from
'
~/repo/repo_service
'
;
import
Store
from
'
~/repo/repo_store
'
;
import
Helper
from
'
~/repo/repo_helper
'
;
describe
(
'
initRepo
'
,
()
=>
{
const
url
=
'
url
'
;
it
(
'
should select all elements, set store service and url, init all needed classes and getContent
'
,
()
=>
{
spyOn
(
Helper
,
'
getContent
'
);
spyOn
(
document
,
'
getElementById
'
).
and
.
callFake
((
selector
)
=>
{
const
element
=
document
.
createElement
(
'
div
'
);
if
(
selector
===
'
ide
'
)
element
.
dataset
.
url
=
url
;
return
element
;
});
require
(
'
~/repo/index
'
);
// eslint-disable-line global-require
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
ide
'
);
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
tabs
'
);
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
sidebar
'
);
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
repo-file-buttons
'
);
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
editable-mode
'
);
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
commit-area
'
);
expect
(
document
.
getElementById
).
toHaveBeenCalledWith
(
'
binary-viewer
'
);
expect
(
Store
.
service
).
toBe
(
Service
);
expect
(
Store
.
service
.
url
).
toBe
(
url
);
expect
(
Store
.
tabs
instanceof
Tabs
).
toBe
(
true
);
expect
(
Store
.
sidebar
instanceof
Sidebar
).
toBe
(
true
);
expect
(
Store
.
editor
instanceof
Editor
).
toBe
(
true
);
expect
(
Store
.
buttons
instanceof
FileButtons
).
toBe
(
true
);
expect
(
Store
.
editButton
instanceof
EditButton
).
toBe
(
true
);
expect
(
Store
.
commitSection
instanceof
CommitSection
).
toBe
(
true
);
expect
(
Store
.
binaryViewer
instanceof
BinaryViewer
).
toBe
(
true
);
expect
(
Helper
.
getContent
).
toHaveBeenCalled
();
});
});
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