Revision 3ce45e715412a95fb0a30209ddaf18faa2db83dc authored by Peter Holmberg on 17 January 2019, 11:57:15 UTC, committed by Peter Holmberg on 17 January 2019, 11:57:15 UTC
1 parent 736db86
Raw File
search.test.ts
import client from './client';
import * as setup from './setup';

describe('GET /api/search', () => {
  const state = {};

  beforeAll(async () => {
    state = await setup.ensureState({
      orgName: 'api-test-org',
      users: [{ user: setup.admin, role: 'Admin' }],
      admin: setup.admin,
      dashboards: [
        {
          title: 'Dashboard in root no permissions',
          uid: 'AAA',
        },
      ],
    });
  });

  describe('With admin user', () => {
    it('should return all dashboards', async () => {
      let rsp = await client.callAs(state.admin).get('/api/search');
      expect(rsp.data).toHaveLength(1);
    });
  });
});
back to top