grafana/public/app/core/components/PageNew/SectionNavItem.test.tsx
Ashley Harrison f7d92ab841
Navigation: only show the img for a section root if both img and icon are present (#62127)
only show an img for a section root if both img and icon are present
2023-01-26 12:07:43 +00:00

26 lines
693 B
TypeScript

import { render, screen } from '@testing-library/react';
import React from 'react';
import { NavModelItem } from '@grafana/data';
import { SectionNavItem } from './SectionNavItem';
describe('SectionNavItem', () => {
it('should only show the img for a section root if both img and icon are present', () => {
const item: NavModelItem = {
text: 'Test',
icon: 'k6',
img: 'img',
children: [
{
text: 'Child',
},
],
};
render(<SectionNavItem item={item} isSectionRoot />);
expect(screen.getByTestId('section-image')).toBeInTheDocument();
expect(screen.queryByTestId('section-icon')).not.toBeInTheDocument();
});
});