diff --git a/src/platform/frontend/components/Input/Input.test.js b/src/platform/frontend/components/Input/Input.test.js new file mode 100644 index 0000000..8416f9b --- /dev/null +++ b/src/platform/frontend/components/Input/Input.test.js @@ -0,0 +1,13 @@ +import React from 'react'; +import { render, fireEvent } from '@testing-library/react'; +import Input from './Input'; + +test('Input renders with value and handles change', () => { + const handleChange = jest.fn(); + const { getByPlaceholderText } = render( + + ); + const input = getByPlaceholderText('Enter text'); + fireEvent.change(input, { target: { value: 'new value' } }); + expect(handleChange).toHaveBeenCalledTimes(1); +});