Files
Ashley Harrison 47f8717149 React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00

31 lines
868 B
TypeScript

import { render, screen } from '@testing-library/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();
});
});