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/plugins/datasource/grafana-azure-monitor-datas.../components/ResourcePicker/NestedEntry.test.tsx

31 lines
895 B

import { render, screen } from '@testing-library/react';
import React from 'react';
import { NestedEntry } from './NestedEntry';
import { ResourceRowType } from './types';
const defaultProps = {
level: 0,
entry: { id: '123', uri: 'someuri', name: '123', type: ResourceRowType.Resource, typeLabel: '' },
isSelected: false,
isSelectable: false,
isOpen: false,
isDisabled: false,
scrollIntoView: false,
onToggleCollapse: jest.fn(),
onSelectedChange: jest.fn(),
};
describe('NestedEntry', () => {
it('should be selectable', () => {
render(<NestedEntry {...defaultProps} isSelectable={true} />);
const box = screen.getByRole('checkbox');
expect(box).toBeInTheDocument();
});
it('should not be selectable', () => {
render(<NestedEntry {...defaultProps} />);
const box = screen.queryByRole('checkbox');
expect(box).not.toBeInTheDocument();
});
});