Skip to content

Commit

Permalink
Create Input.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Fast677 authored Feb 11, 2025
1 parent 3235691 commit 73e5105
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/platform/frontend/components/Input/Input.test.js
Original file line number Diff line number Diff line change
@@ -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(
<Input value="test" onChange={handleChange} placeholder="Enter text" />
);
const input = getByPlaceholderText('Enter text');
fireEvent.change(input, { target: { value: 'new value' } });
expect(handleChange).toHaveBeenCalledTimes(1);
});

0 comments on commit 73e5105

Please sign in to comment.