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
Léo-Paul Géneau
gitlab-ce
Commits
33946909
Commit
33946909
authored
Jul 31, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests
parent
ec0ea51f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
spec/javascripts/groups/groups_spec.js
spec/javascripts/groups/groups_spec.js
+15
-0
spec/javascripts/groups/mock_data.js
spec/javascripts/groups/mock_data.js
+1
-1
No files found.
spec/javascripts/groups/groups_spec.js
View file @
33946909
...
...
@@ -2,6 +2,7 @@ import Vue from 'vue';
import
eventHub
from
'
~/groups/event_hub
'
;
import
groupFolderComponent
from
'
~/groups/components/group_folder.vue
'
;
import
groupItemComponent
from
'
~/groups/components/group_item.vue
'
;
import
groupIdenticonComponent
from
'
~/groups/components/group_identicon.vue
'
;
import
groupsComponent
from
'
~/groups/components/groups.vue
'
;
import
GroupsStore
from
'
~/groups/stores/groups_store
'
;
import
{
groupsData
}
from
'
./mock_data
'
;
...
...
@@ -14,6 +15,7 @@ describe('Groups Component', () => {
beforeEach
((
done
)
=>
{
Vue
.
component
(
'
group-folder
'
,
groupFolderComponent
);
Vue
.
component
(
'
group-identicon
'
,
groupIdenticonComponent
);
Vue
.
component
(
'
group-item
'
,
groupItemComponent
);
store
=
new
GroupsStore
();
...
...
@@ -64,6 +66,19 @@ describe('Groups Component', () => {
expect
(
lists
[
2
].
querySelector
(
'
#group-1120
'
).
textContent
).
toContain
(
groups
.
id1119
.
subGroups
.
id1120
.
name
);
});
it
(
'
should render group identicon when group avatar is not present
'
,
()
=>
{
const
avatar
=
component
.
$el
.
querySelector
(
'
#group-12 .avatar-container .avatar
'
);
expect
(
avatar
.
nodeName
).
toBe
(
'
DIV
'
);
expect
(
avatar
.
classList
.
contains
(
'
identicon
'
)).
toBeTruthy
();
expect
(
avatar
.
getAttribute
(
'
style
'
).
indexOf
(
'
background-color
'
)
>
-
1
).
toBeTruthy
();
});
it
(
'
should render group avatar when group avatar is present
'
,
()
=>
{
const
avatar
=
component
.
$el
.
querySelector
(
'
#group-1120 .avatar-container .avatar
'
);
expect
(
avatar
.
nodeName
).
toBe
(
'
IMG
'
);
expect
(
avatar
.
classList
.
contains
(
'
identicon
'
)).
toBeFalsy
();
});
it
(
'
should remove prefix of parent group
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
#group-12 #group-1128 .title
'
).
textContent
).
toContain
(
'
level2 / level3 / level4
'
);
});
...
...
spec/javascripts/groups/mock_data.js
View file @
33946909
...
...
@@ -71,7 +71,7 @@ const group21 = {
path
:
'
chef
'
,
description
:
'
foo
'
,
visibility
:
'
public
'
,
avatar_url
:
null
,
avatar_url
:
'
/uploads/-/system/group/avatar/2/GitLab.png
'
,
web_url
:
'
http://localhost:3000/groups/devops/chef
'
,
group_path
:
'
/devops/chef
'
,
full_name
:
'
devops / chef
'
,
...
...
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