import { cleanup, fireEvent } from '@testing-library/react';
import { render } from '../../../utils/theme-render-wrapper';
import { Input } from './input';
afterEach(cleanup);
const handleClick = jest.fn();
describe('', () => {
it('should render successfully', () => {
const { baseElement } = render();
expect(baseElement).toBeTruthy();
});
it('should render disabled password input', () => {
const { baseElement } = render();
expect(baseElement).toBeTruthy();
});
it('should render with password visibility toggler', () => {
const { queryByTestId } = render();
const iconButton = queryByTestId('togglePasswordVisibilityIconButton');
if (iconButton) {
fireEvent.click(iconButton);
fireEvent.mouseDown(iconButton);
}
});
it('should render with endAdornmentButtonProps', () => {
const { queryByTestId } = render(
);
queryByTestId('endAdornmentButton')?.click();
expect(handleClick).toBeCalledTimes(1);
});
});