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
1f0a785d
Commit
1f0a785d
authored
May 22, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic tests for groups component
[ci skip]
parent
a5a7b574
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
4 deletions
+80
-4
app/assets/javascripts/groups/components/group_folder.vue
app/assets/javascripts/groups/components/group_folder.vue
+1
-1
app/assets/javascripts/groups/components/groups.vue
app/assets/javascripts/groups/components/groups.vue
+1
-1
app/assets/javascripts/pipelines/pipelines.js
app/assets/javascripts/pipelines/pipelines.js
+0
-2
spec/javascripts/groups/groups_spec.js
spec/javascripts/groups/groups_spec.js
+38
-0
spec/javascripts/groups/mock_data.js
spec/javascripts/groups/mock_data.js
+40
-0
No files found.
app/assets/javascripts/groups/components/group_folder.vue
View file @
1f0a785d
...
@@ -16,6 +16,6 @@ export default {
...
@@ -16,6 +16,6 @@ export default {
<
template
>
<
template
>
<ul
class=
"content-list group-list-tree"
v-show=
"hasGroups"
>
<ul
class=
"content-list group-list-tree"
v-show=
"hasGroups"
>
<group-item
v-for=
"
group in groups
"
:group=
"group"
/>
<group-item
v-for=
"
(group, index) in groups"
:key=
"index
"
:group=
"group"
/>
</ul>
</ul>
</
template
>
</
template
>
app/assets/javascripts/groups/components/groups.vue
View file @
1f0a785d
...
@@ -27,7 +27,7 @@ export default {
...
@@ -27,7 +27,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<div
class=
"groups-list-tree-container"
>
<group-folder
:groups=
"groups"
/>
<group-folder
:groups=
"groups"
/>
<gl-pagination
<gl-pagination
:change=
"change"
:change=
"change"
...
...
app/assets/javascripts/pipelines/pipelines.js
View file @
1f0a785d
...
@@ -277,9 +277,7 @@ export default {
...
@@ -277,9 +277,7 @@ export default {
<gl-pagination
<gl-pagination
v-if="shouldRenderPagination"
v-if="shouldRenderPagination"
:pagenum="pagenum"
:change="change"
:change="change"
:count="state.count.all"
:pageInfo="state.pageInfo"/>
:pageInfo="state.pageInfo"/>
</div>
</div>
</div>
</div>
...
...
spec/javascripts/groups/groups_spec.js
0 → 100644
View file @
1f0a785d
import
Vue
from
'
vue
'
;
import
GroupFolder
from
'
~/groups/components/group_folder.vue
'
;
import
GroupItem
from
'
~/groups/components/group_item.vue
'
;
import
groupsComponent
from
'
~/groups/components/groups.vue
'
;
import
GroupsStore
from
'
~/groups/stores/groups_store
'
;
import
groupsData
from
'
./mock_data
'
;
describe
(
'
Groups
'
,
()
=>
{
let
GroupsComponent
;
let
store
;
beforeEach
(()
=>
{
Vue
.
component
(
'
group-folder
'
,
GroupFolder
);
Vue
.
component
(
'
group-item
'
,
GroupItem
);
store
=
new
GroupsStore
();
store
.
setGroups
(
groupsData
.
groups
);
store
.
storePagination
(
groupsData
.
pagination
);
GroupsComponent
=
Vue
.
extend
(
groupsComponent
);
});
describe
(
'
with data
'
,
()
=>
{
it
(
'
should render a list of groups
'
,
(
done
)
=>
{
const
component
=
new
GroupsComponent
({
propsData
:
{
groups
:
store
.
state
.
groups
,
pageInfo
:
store
.
state
.
pageInfo
,
},
}).
$mount
();
setTimeout
(()
=>
{
expect
(
component
.
$el
.
classList
.
contains
(
'
groups-list-tree-container
'
)).
toBe
(
true
);
done
();
});
});
});
});
spec/javascripts/groups/mock_data.js
0 → 100644
View file @
1f0a785d
export
default
{
groups
:
[{
id
:
'
12
'
,
name
:
'
level1
'
,
path
:
'
level1
'
,
description
:
''
,
visibility
:
'
public
'
,
avatar_url
:
null
,
web_url
:
'
http://localhost:3000/groups/level1
'
,
full_name
:
'
level1
'
,
full_path
:
'
level1
'
,
parent_id
:
null
,
created_at
:
'
2017-05-15T19:01:23.670Z
'
,
updated_at
:
'
2017-05-15T19:01:23.670Z
'
,
permissions
:
{
group_access
:
50
,
},
},
],
pagination
:
{
Date
:
'
Mon, 22 May 2017 22:31:52 GMT
'
,
'
X-Prev-Page
'
:
'
1
'
,
'
X-Content-Type-Options
'
:
'
nosniff
'
,
'
X-Total
'
:
'
31
'
,
'
Transfer-Encoding
'
:
'
chunked
'
,
'
X-Runtime
'
:
'
0.611144
'
,
'
X-Xss-Protection
'
:
'
1; mode=block
'
,
'
X-Request-Id
'
:
'
f5db8368-3ce5-4aa4-89d2-a125d9dead09
'
,
'
X-Ua-Compatible
'
:
'
IE=edge
'
,
'
X-Per-Page
'
:
'
20
'
,
Link
:
'
<http://localhost:3000/dashboard/groups.json?page=1&per_page=20>; rel="prev", <http://localhost:3000/dashboard/groups.json?page=1&per_page=20>; rel="first", <http://localhost:3000/dashboard/groups.json?page=2&per_page=20>; rel="last"
'
,
'
X-Next-Page
'
:
''
,
Etag
:
'
W/"a82f846947136271cdb7d55d19ef33d2"
'
,
'
X-Frame-Options
'
:
'
DENY
'
,
'
Content-Type
'
:
'
application/json; charset=utf-8
'
,
'
Cache-Control
'
:
'
max-age=0, private, must-revalidate
'
,
'
X-Total-Pages
'
:
'
2
'
,
'
X-Page
'
:
'
2
'
,
},
};
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