import { render, fireEvent } from '@testing-library/react-native'; import { MeasurementInput } from '../MeasurementInput'; describe('MeasurementInput', () => { it('renders correctly', () => { const { getByPlaceholderText } = render(); const input = getByPlaceholderText('Enter measurement'); expect(input).toBeTruthy(); }); it('calls onValueSet when value is changed', () => { const mockOnValueSet = jest.fn(); const { getByPlaceholderText } = render(); const input = getByPlaceholderText('Enter measurement'); fireEvent.changeText(input, '20'); expect(mockOnValueSet).toHaveBeenCalledWith({ l: 20, u: 'foot' }); }); });