{"size": 986, "ext": "js", "max_stars_repo_path": "src/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js", "max_stars_repo_name": "pingidentity/astro", "max_stars_repo_stars_event_min_datetime": "2022-01-22T03:09:32.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T06:47:12.000Z", "max_issues_repo_path": "src/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js", "max_issues_repo_name": "pingidentity/astro", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js", "max_forks_repo_name": "pingidentity/astro", "max_forks_repo_forks_event_min_datetime": "2022-01-23T05:11:41.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-23T23:01:47.000Z"}
{"max_stars_count": 7, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 29.8787878788, "max_line_length": 70, "alphanum_fraction": 0.7221095335}
import React from 'react';
import axeTest from '../../utils/testUtils/testAxe';
import { render, screen } from '../../utils/testUtils/testWrapper';
import CollapsiblePanelBadge from './CollapsiblePanelBadge';

const testId = 'test-collapsiblePanelBadge';
const defaultProps = {
  'data-testid': testId,
  selectedFilterCount: 9,
};
const getComponent = (props = {}) => render(
  <CollapsiblePanelBadge {...defaultProps} {...props} />,
);

afterEach(() => {
  jest.restoreAllMocks();
});

// Need to be added to each test file to test accessibility using axe.
axeTest(getComponent);

test('default CollapsiblePanelBadge', () => {
  getComponent();
  const collapsiblePanelBadge = screen.getByTestId(testId);
  expect(collapsiblePanelBadge).toBeInTheDocument();
});

test('custom classname can be passed', () => {
  getComponent({ className: 'testing-class' });
  const collapsiblePanelBadge = screen.getByTestId(testId);
  expect(collapsiblePanelBadge).toHaveClass('testing-class');
});
