Files
Sarah Zinger a8354a0319 Azure Monitor: add search feature to resource picker. (#48234)
Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
2022-05-03 03:57:56 +02:00

32 lines
895 B
TypeScript

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();
});
});