search.test.ts 655 B

123456789101112131415161718192021222324252627
  1. import client from './client';
  2. import * as setup from './setup';
  3. describe('GET /api/search', () => {
  4. const state = {};
  5. beforeAll(async () => {
  6. state = await setup.ensureState({
  7. orgName: 'api-test-org',
  8. users: [{ user: setup.admin, role: 'Admin' }],
  9. admin: setup.admin,
  10. dashboards: [
  11. {
  12. title: 'Dashboard in root no permissions',
  13. uid: 'AAA',
  14. },
  15. ],
  16. });
  17. });
  18. describe('With admin user', () => {
  19. it('should return all dashboards', async () => {
  20. let rsp = await client.callAs(state.admin).get('/api/search');
  21. expect(rsp.data).toHaveLength(1);
  22. });
  23. });
  24. });