The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/alerting/unified/components/expressions/ExpressionStatusIndicator.t...

19 lines
716 B

import { screen, render } from '@testing-library/react';
import React from 'react';
import { ExpressionStatusIndicator } from './ExpressionStatusIndicator';
describe('ExpressionStatusIndicator', () => {
it('should render one element if condition', () => {
render(<ExpressionStatusIndicator isCondition />);
expect(screen.getByText('Alert condition')).toBeInTheDocument();
});
it('should render one element if not condition', () => {
render(<ExpressionStatusIndicator isCondition={false} />);
expect(screen.queryByRole('button', { name: 'Alert condition' })).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Set as alert condition' })).toBeInTheDocument();
});
});