import React from 'react';
import { render, fireEvent, waitForElement } from '@testing-library/react';
import Button from '../Button';

describe('Button', () => {
    it('should render button', async () => {
        const handleClick = jest.fn();
        const { getByText } = render(
            <Button onClick={handleClick} activeButton={true}>
                Button
            </Button>,
        );
        await waitForElement(() => fireEvent.click(getByText('Button')));
        expect(handleClick).toHaveBeenCalledTimes(1);
    });
});
