Commit a77c6560 by Daniel Lee

dashfolders: adds test for permission store

parent cc55ab6b
...@@ -57,30 +57,30 @@ describe('PermissionsStore', () => { ...@@ -57,30 +57,30 @@ describe('PermissionsStore', () => {
expect(backendSrv.post.mock.calls[0][0]).toBe('/api/dashboards/id/1/acl'); expect(backendSrv.post.mock.calls[0][0]).toBe('/api/dashboards/id/1/acl');
}); });
// describe('when duplicate team permissions are added', () => { describe('when duplicate team permissions are added', () => {
// beforeEach(() => { beforeEach(() => {
// const newItem = { const newItem = {
// teamId: 10, teamId: 10,
// team: 'tester-team', team: 'tester-team',
// permission: 1, permission: 1,
// dashboardId: 1, dashboardId: 1,
// }; };
// store.resetNewType(); store.resetNewType();
// store.newItem.setTeam(newItem.teamId, newItem.team); store.newItem.setTeam(newItem.teamId, newItem.team);
// store.newItem.setPermission(newItem.permission); store.newItem.setPermission(newItem.permission);
// store.addStoreItem(); store.addStoreItem();
// store.newItem.setTeam(newItem.teamId, newItem.team); store.newItem.setTeam(newItem.teamId, newItem.team);
// store.newItem.setPermission(newItem.permission); store.newItem.setPermission(newItem.permission);
// store.addStoreItem(); store.addStoreItem();
// }); });
// it('should return a validation error', () => { it('should return a validation error', () => {
// expect(store.items.length).toBe(4); expect(store.items.length).toBe(4);
// expect(store.error).toBe('This permission exists already.'); expect(store.error).toBe('This permission exists already.');
// expect(backendSrv.post.mock.calls.length).toBe(1); expect(backendSrv.post.mock.calls.length).toBe(1);
// }); });
// }); });
describe('when duplicate user permissions are added', () => { describe('when duplicate user permissions are added', () => {
beforeEach(() => { beforeEach(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment