|
|
@ -4,7 +4,6 @@ import { render, screen } from 'test/test-utils'; |
|
|
|
|
|
|
|
|
|
|
|
import { contextSrv } from 'app/core/services/context_srv'; |
|
|
|
import { contextSrv } from 'app/core/services/context_srv'; |
|
|
|
import { setFolderResponse } from 'app/features/alerting/unified/mocks/server/configure'; |
|
|
|
import { setFolderResponse } from 'app/features/alerting/unified/mocks/server/configure'; |
|
|
|
import { MIMIR_DATASOURCE_UID } from 'app/features/alerting/unified/mocks/server/constants'; |
|
|
|
|
|
|
|
import { captureRequests } from 'app/features/alerting/unified/mocks/server/events'; |
|
|
|
import { captureRequests } from 'app/features/alerting/unified/mocks/server/events'; |
|
|
|
import { DashboardSearchItemType } from 'app/features/search/types'; |
|
|
|
import { DashboardSearchItemType } from 'app/features/search/types'; |
|
|
|
import { AccessControlAction } from 'app/types'; |
|
|
|
import { AccessControlAction } from 'app/types'; |
|
|
@ -12,6 +11,7 @@ import { AccessControlAction } from 'app/types'; |
|
|
|
import { setupMswServer } from '../mockApi'; |
|
|
|
import { setupMswServer } from '../mockApi'; |
|
|
|
import { grantUserPermissions, mockDataSource, mockFolder } from '../mocks'; |
|
|
|
import { grantUserPermissions, mockDataSource, mockFolder } from '../mocks'; |
|
|
|
import { grafanaRulerRule } from '../mocks/grafanaRulerApi'; |
|
|
|
import { grafanaRulerRule } from '../mocks/grafanaRulerApi'; |
|
|
|
|
|
|
|
import { MIMIR_DATASOURCE_UID } from '../mocks/server/constants'; |
|
|
|
import { setupDataSources } from '../testSetup/datasources'; |
|
|
|
import { setupDataSources } from '../testSetup/datasources'; |
|
|
|
import { Annotation } from '../utils/constants'; |
|
|
|
import { Annotation } from '../utils/constants'; |
|
|
|
|
|
|
|
|
|
|
@ -151,3 +151,15 @@ describe('RuleEditor grafana managed rules', () => { |
|
|
|
expect(postBody.interval).toBe('12m'); |
|
|
|
expect(postBody.interval).toBe('12m'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('Data source managed rules', () => { |
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
|
|
|
|
jest.clearAllMocks(); |
|
|
|
|
|
|
|
grantUserPermissions([AccessControlAction.AlertingRuleExternalRead, AccessControlAction.AlertingRuleExternalWrite]); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should show an error if the data source does not exist', async () => { |
|
|
|
|
|
|
|
renderRuleEditor('cri%24grafana-cloudd%24delete me%24delete me 3%24recording_rule_delete_2%24-476183141'); |
|
|
|
|
|
|
|
expect(await screen.findByText(/unable to find data source/i)).toBeInTheDocument(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|