Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e3fc61b3
Commit
e3fc61b3
authored
Mar 14, 2019
by
Hugo Häggmark
Committed by
Leonard Gram
Mar 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: moved test from TeamMembers to TeamMemberRow
parent
178d637b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
204 deletions
+64
-204
public/app/features/teams/TeamMemberRow.test.tsx
+8
-0
public/app/features/teams/TeamMembers.test.tsx
+0
-6
public/app/features/teams/__snapshots__/TeamMemberRow.test.tsx.snap
+51
-0
public/app/features/teams/__snapshots__/TeamMembers.test.tsx.snap
+5
-198
No files found.
public/app/features/teams/TeamMemberRow.test.tsx
View file @
e3fc61b3
...
...
@@ -27,6 +27,14 @@ const setup = (propOverrides?: object) => {
};
describe
(
'Render'
,
()
=>
{
it
(
'should render team members when sync enabled'
,
()
=>
{
const
member
=
getMockTeamMember
();
member
.
labels
=
[
'LDAP'
];
const
{
wrapper
}
=
setup
({
member
,
syncEnabled
:
true
});
expect
(
wrapper
).
toMatchSnapshot
();
});
describe
(
'when feature toggle editorsCanAdmin is turned on'
,
()
=>
{
it
(
'should render permissions select if user is team admin'
,
()
=>
{
const
{
wrapper
}
=
setup
({
editorsCanAdmin
:
true
,
signedInUserIsTeamAdmin
:
true
});
...
...
public/app/features/teams/TeamMembers.test.tsx
View file @
e3fc61b3
...
...
@@ -46,12 +46,6 @@ describe('Render', () => {
expect
(
wrapper
).
toMatchSnapshot
();
});
it
(
'should render team members when sync enabled'
,
()
=>
{
const
{
wrapper
}
=
setup
({
members
:
getMockTeamMembers
(
5
,
5
),
syncEnabled
:
true
});
expect
(
wrapper
).
toMatchSnapshot
();
});
});
describe
(
'Functions'
,
()
=>
{
...
...
public/app/features/teams/__snapshots__/TeamMemberRow.test.tsx.snap
View file @
e3fc61b3
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render should render team members when sync enabled 1`] = `
<tr
key="1"
>
<td
className="width-4 text-center"
>
<img
className="filter-table__avatar"
src="some/url/"
/>
</td>
<td>
testUser
</td>
<td>
test@test.com
</td>
<Component
featureToggle={false}
>
<td>
<div
className="gf-form"
>
<span>
Member
</span>
</div>
</td>
</Component>
<td>
<TagBadge
count={0}
key="LDAP"
label="LDAP"
onClick={[Function]}
removeIcon={false}
/>
</td>
<td
className="text-right"
>
<DeleteButton
disabled={true}
onConfirm={[Function]}
/>
</td>
</tr>
`;
exports[`Render when feature toggle editorsCanAdmin is turned off should not render permissions 1`] = `
<tr
key="1"
...
...
public/app/features/teams/__snapshots__/TeamMembers.test.tsx.snap
View file @
e3fc61b3
...
...
@@ -177,7 +177,7 @@ exports[`Render should render team members 1`] = `
</tr>
</thead>
<tbody>
<
TeamMemberRow
<
Connect(TeamMemberRow)
editorsCanAdmin={false}
key="1"
member={
...
...
@@ -197,7 +197,7 @@ exports[`Render should render team members 1`] = `
signedInUserIsTeamAdmin={true}
syncEnabled={false}
/>
<
TeamMemberRow
<
Connect(TeamMemberRow)
editorsCanAdmin={false}
key="2"
member={
...
...
@@ -217,7 +217,7 @@ exports[`Render should render team members 1`] = `
signedInUserIsTeamAdmin={true}
syncEnabled={false}
/>
<
TeamMemberRow
<
Connect(TeamMemberRow)
editorsCanAdmin={false}
key="3"
member={
...
...
@@ -237,7 +237,7 @@ exports[`Render should render team members 1`] = `
signedInUserIsTeamAdmin={true}
syncEnabled={false}
/>
<
TeamMemberRow
<
Connect(TeamMemberRow)
editorsCanAdmin={false}
key="4"
member={
...
...
@@ -257,7 +257,7 @@ exports[`Render should render team members 1`] = `
signedInUserIsTeamAdmin={true}
syncEnabled={false}
/>
<
TeamMemberRow
<
Connect(TeamMemberRow)
editorsCanAdmin={false}
key="5"
member={
...
...
@@ -282,196 +282,3 @@ exports[`Render should render team members 1`] = `
</div>
</div>
`;
exports[`Render should render team members when sync enabled 1`] = `
<div>
<div
className="page-action-bar"
>
<div
className="gf-form gf-form--grow"
>
<ForwardRef
inputClassName="gf-form-input"
labelClassName="gf-form--has-input-icon gf-form--grow"
onChange={[Function]}
placeholder="Search members"
value=""
/>
</div>
<div
className="page-action-bar__spacer"
/>
<button
className="btn btn-primary pull-right"
disabled={false}
onClick={[Function]}
>
Add member
</button>
</div>
<Component
in={false}
>
<div
className="cta-form"
>
<button
className="cta-form__close btn btn-transparent"
onClick={[Function]}
>
<i
className="fa fa-close"
/>
</button>
<h5>
Add team member
</h5>
<div
className="gf-form-inline"
>
<UserPicker
className="min-width-30"
onSelected={[Function]}
/>
</div>
</div>
</Component>
<div
className="admin-list-table"
>
<table
className="filter-table filter-table--hover form-inline"
>
<thead>
<tr>
<th />
<th>
Name
</th>
<th>
Email
</th>
<Component
featureToggle={false}
>
<th>
Permission
</th>
</Component>
<th />
<th
style={
Object {
"width": "1%",
}
}
/>
</tr>
</thead>
<tbody>
<TeamMemberRow
editorsCanAdmin={false}
key="1"
member={
Object {
"avatarUrl": "some/url/",
"email": "test@test.com",
"labels": Array [
"label 1",
"label 2",
],
"login": "testUser-1",
"permission": 0,
"teamId": 1,
"userId": 1,
}
}
signedInUserIsTeamAdmin={true}
syncEnabled={true}
/>
<TeamMemberRow
editorsCanAdmin={false}
key="2"
member={
Object {
"avatarUrl": "some/url/",
"email": "test@test.com",
"labels": Array [
"label 1",
"label 2",
],
"login": "testUser-2",
"permission": 0,
"teamId": 1,
"userId": 2,
}
}
signedInUserIsTeamAdmin={true}
syncEnabled={true}
/>
<TeamMemberRow
editorsCanAdmin={false}
key="3"
member={
Object {
"avatarUrl": "some/url/",
"email": "test@test.com",
"labels": Array [
"label 1",
"label 2",
],
"login": "testUser-3",
"permission": 0,
"teamId": 1,
"userId": 3,
}
}
signedInUserIsTeamAdmin={true}
syncEnabled={true}
/>
<TeamMemberRow
editorsCanAdmin={false}
key="4"
member={
Object {
"avatarUrl": "some/url/",
"email": "test@test.com",
"labels": Array [
"label 1",
"label 2",
],
"login": "testUser-4",
"permission": 0,
"teamId": 1,
"userId": 4,
}
}
signedInUserIsTeamAdmin={true}
syncEnabled={true}
/>
<TeamMemberRow
editorsCanAdmin={false}
key="5"
member={
Object {
"avatarUrl": "some/url/",
"email": "test@test.com",
"labels": Array [
"label 1",
"label 2",
],
"login": "testUser-5",
"permission": 4,
"teamId": 1,
"userId": 5,
}
}
signedInUserIsTeamAdmin={true}
syncEnabled={true}
/>
</tbody>
</table>
</div>
</div>
`;
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