import React from 'react'; import { mount } from 'enzyme'; import LabelPill, { LabelPillStatus } from '..'; describe('components/label-pill/LabelPill', () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const FormattedMessage = (msgObject: any) => {msgObject.defaultMessage}; // eslint-disable-next-line @typescript-eslint/no-explicit-any const MockIcon = (props: any) => ( ); test('should render default DOM with message', () => { const fullComponent = mount( , ); expect(fullComponent).toMatchSnapshot(); }); test('should render default DOM with icon component', () => { const fullComponent = mount( , ); expect(fullComponent).toMatchSnapshot(); }); test('should include DOM for tooltip if specified', () => { const fullComponent = mount( , ); expect(fullComponent).toMatchSnapshot(); }); test('should spread props on the proper DOM element', () => { const expectedText = 'Sample ARIA text'; const labelType = 'warning'; const componentWithAria = mount( , ); expect(componentWithAria.find('.bdl-LabelPill').prop('aria-label')).toBe(expectedText); expect(componentWithAria.find(`.bdl-LabelPill--${labelType}`)).toHaveLength(1); }); });