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
a77c6560
Commit
a77c6560
authored
Feb 01, 2018
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashfolders: adds test for permission store
parent
cc55ab6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
public/app/stores/PermissionsStore/PermissionsStore.jest.ts
+24
-24
No files found.
public/app/stores/PermissionsStore/PermissionsStore.jest.ts
View file @
a77c6560
...
...
@@ -57,30 +57,30 @@ describe('PermissionsStore', () => {
expect
(
backendSrv
.
post
.
mock
.
calls
[
0
][
0
]).
toBe
(
'/api/dashboards/id/1/acl'
);
});
//
describe('when duplicate team permissions are added', () => {
//
beforeEach(() => {
//
const newItem = {
//
teamId: 10,
//
team: 'tester-team',
//
permission: 1,
//
dashboardId: 1,
//
};
//
store.resetNewType();
//
store.newItem.setTeam(newItem.teamId, newItem.team);
//
store.newItem.setPermission(newItem.permission);
//
store.addStoreItem();
//
store.newItem.setTeam(newItem.teamId, newItem.team);
//
store.newItem.setPermission(newItem.permission);
//
store.addStoreItem();
//
});
//
it('should return a validation error', () => {
//
expect(store.items.length).toBe(4);
//
expect(store.error).toBe('This permission exists already.');
//
expect(backendSrv.post.mock.calls.length).toBe(1);
//
});
//
});
describe
(
'when duplicate team permissions are added'
,
()
=>
{
beforeEach
(()
=>
{
const
newItem
=
{
teamId
:
10
,
team
:
'tester-team'
,
permission
:
1
,
dashboardId
:
1
,
};
store
.
resetNewType
();
store
.
newItem
.
setTeam
(
newItem
.
teamId
,
newItem
.
team
);
store
.
newItem
.
setPermission
(
newItem
.
permission
);
store
.
addStoreItem
();
store
.
newItem
.
setTeam
(
newItem
.
teamId
,
newItem
.
team
);
store
.
newItem
.
setPermission
(
newItem
.
permission
);
store
.
addStoreItem
();
});
it
(
'should return a validation error'
,
()
=>
{
expect
(
store
.
items
.
length
).
toBe
(
4
);
expect
(
store
.
error
).
toBe
(
'This permission exists already.'
);
expect
(
backendSrv
.
post
.
mock
.
calls
.
length
).
toBe
(
1
);
});
});
describe
(
'when duplicate user permissions are added'
,
()
=>
{
beforeEach
(()
=>
{
...
...
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