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
417830ae
Commit
417830ae
authored
Jul 26, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish repo_tabs_spec
parent
e4836fdb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
spec/javascripts/repo/repo_tabs_spec.js
spec/javascripts/repo/repo_tabs_spec.js
+40
-4
No files found.
spec/javascripts/repo/repo_tabs_spec.js
View file @
417830ae
import
Vue
from
'
vue
'
;
import
RepoStore
from
'
~/repo/repo_store
'
;
import
repoTabs
from
'
~/repo/repo_tabs.vue
'
;
describe
(
'
RepoTabss
'
,
()
=>
{
describe
(
'
RepoTabs
'
,
()
=>
{
const
openedFiles
=
[{
id
:
0
,
active
:
true
,
},
{
id
:
1
,
}];
function
createComponent
()
{
const
RepoTabs
=
Vue
.
extend
(
repoTabs
);
function
createComponent
()
{
return
new
RepoTabs
().
$mount
();
}
beforeEach
(()
=>
{
spyOn
(
repoTabs
.
methods
,
'
isOverflow
'
);
});
it
(
'
renders a list of tabs
'
,
()
=>
{
RepoStore
.
openedFiles
=
openedFiles
;
RepoStore
.
tabsOverflow
=
true
;
const
vm
=
createComponent
();
const
tabs
=
[...
vm
.
$el
.
querySelectorAll
(
'
:scope > li
'
)];
expect
(
vm
.
$el
.
id
).
toEqual
(
'
tabs
'
);
expect
(
vm
.
$el
.
classList
.
contains
(
'
overflown
'
)).
toBeTruthy
();
expect
(
tabs
.
length
).
toEqual
(
2
);
expect
(
tabs
[
0
].
classList
.
contains
(
'
active
'
)).
toBeTruthy
();
expect
(
tabs
[
1
].
classList
.
contains
(
'
active
'
)).
toBeFalsy
();
});
it
(
'
does not render a tabs list if no isMini
'
,
()
=>
{
it
(
'
does not render a tabs list if not isMini
'
,
()
=>
{
RepoStore
.
openedFiles
=
[];
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
innerHTML
).
toBeFalsy
();
});
it
(
'
does not apply overflown class if not tabsOverflow
'
,
()
=>
{
RepoStore
.
openedFiles
=
openedFiles
;
RepoStore
.
tabsOverflow
=
false
;
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
classList
.
contains
(
'
overflown
'
)).
toBeFalsy
();
});
});
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