detailPanel.spec.tsx 930 B

12345678910111213141516171819202122
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import DetailPanel from 'sentry/views/starfish/components/detailPanel';
  3. describe('DetailPanel', function () {
  4. it('renders toolbar and inner content', function () {
  5. render(<DetailPanel detailKey={'true'}>Content</DetailPanel>);
  6. expect(screen.getByRole('button', {name: 'Dock to the bottom'})).toBeInTheDocument();
  7. expect(screen.getByRole('button', {name: 'Dock to the right'})).toBeInTheDocument();
  8. expect(screen.getByRole('button', {name: 'Close Details'})).toBeInTheDocument();
  9. expect(screen.getByText('Content')).toBeInTheDocument();
  10. });
  11. it('does not render content when closed', function () {
  12. render(<DetailPanel detailKey={undefined}>Content</DetailPanel>);
  13. expect(screen.queryByRole('button', {name: 'Close Details'})).not.toBeInTheDocument();
  14. expect(screen.queryByText('Content')).not.toBeInTheDocument();
  15. });
  16. });