import { render, screen } from '../../test-utils';

import { CloseButton } from '.';

const props = {
  className: 'className',
  onClick: jest.fn(),
};

describe('CloseButton', () => {
  describe('tabIndex', () => {
    it('should not have tabIndex by default', () => {
      render(<CloseButton {...props} />);
      expect(screen.getByRole('button')).not.toHaveAttribute('tabIndex');
    });

    it('should support tabIndex', () => {
      render(<CloseButton {...props} tabIndex={0} />);
      expect(screen.getByRole('button')).toHaveAttribute('tabIndex', '0');
    });
  });
});
