mirror of https://github.com/grafana/grafana
Alerting: Fix alert rule loading states v2 (#100747)
parent
af7fafd03a
commit
fe2beead15
@ -0,0 +1,16 @@ |
|||||||
|
import { render, screen } from 'test/test-utils'; |
||||||
|
|
||||||
|
import RuleViewer from './RuleViewer'; |
||||||
|
import { stringifyErrorLike } from './utils/misc'; |
||||||
|
|
||||||
|
describe('Rule Viewer page', () => { |
||||||
|
it('should throw an error if rule ID cannot be decoded', () => { |
||||||
|
// check console errors
|
||||||
|
jest.spyOn(console, 'error').mockImplementation((error) => { |
||||||
|
expect(stringifyErrorLike(error)).toContain('Error: Rule ID is required'); |
||||||
|
}); |
||||||
|
|
||||||
|
render(<RuleViewer />); |
||||||
|
expect(screen.getByText(/Error: Rule ID is required/i)).toBeInTheDocument(); |
||||||
|
}); |
||||||
|
}); |
Loading…
Reference in new issue