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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f9a9e9a2
Commit
f9a9e9a2
authored
Apr 18, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GroupMemberContributions Table Body
parent
b4d2709d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
ee/app/assets/javascripts/group_member_contributions/components/table_body.vue
...ipts/group_member_contributions/components/table_body.vue
+31
-0
spec/javascripts/group_member_contributions/components/table_body_spec.js
.../group_member_contributions/components/table_body_spec.js
+44
-0
No files found.
ee/app/assets/javascripts/group_member_contributions/components/table_body.vue
0 → 100644
View file @
f9a9e9a2
<
script
>
export
default
{
props
:
{
rows
:
{
type
:
Array
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<tbody>
<tr
v-for=
"(row, index) of rows"
:key=
"index"
>
<td>
<strong>
<a
:href=
"row.userWebUrl"
>
{{
row
.
fullname
}}
</a>
</strong>
</td>
<td>
{{
row
.
push
}}
</td>
<td>
{{
row
.
issuesCreated
}}
</td>
<td>
{{
row
.
issuesClosed
}}
</td>
<td>
{{
row
.
mergeRequestsCreated
}}
</td>
<td>
{{
row
.
mergeRequestsMerged
}}
</td>
<td>
{{
row
.
totalEvents
}}
</td>
</tr>
</tbody>
</
template
>
spec/javascripts/group_member_contributions/components/table_body_spec.js
0 → 100644
View file @
f9a9e9a2
import
Vue
from
'
vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
TableBodyComponent
from
'
ee/group_member_contributions/components/table_body.vue
'
;
import
GroupMemberStore
from
'
ee/group_member_contributions/store/group_member_store
'
;
import
{
rawMembers
}
from
'
../mock_data
'
;
const
createComponent
=
()
=>
{
const
Component
=
Vue
.
extend
(
TableBodyComponent
);
const
store
=
new
GroupMemberStore
();
store
.
setMembers
(
rawMembers
);
const
rows
=
store
.
members
;
return
mountComponent
(
Component
,
{
rows
});
};
describe
(
'
TableBodyComponent
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders row item element
'
,
()
=>
{
const
rowEl
=
vm
.
$el
.
querySelector
(
'
tr
'
);
expect
(
rowEl
).
not
.
toBeNull
();
expect
(
rowEl
.
querySelectorAll
(
'
td
'
).
length
).
toBe
(
7
);
});
it
(
'
renders username row cell element
'
,
()
=>
{
const
cellEl
=
vm
.
$el
.
querySelector
(
'
td strong
'
);
expect
(
cellEl
).
not
.
toBeNull
();
expect
(
cellEl
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
)).
toBe
(
rawMembers
[
0
].
user_web_url
);
});
});
});
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