Skip to content

Commit c2183a7

Browse files
committed
chore: add relevant tests
1 parent 0ae6dd0 commit c2183a7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/queries/__tests__/display-value.test.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { TextInput, View } from 'react-native';
3-
import { render, screen } from '../..';
3+
import { fireEvent, render, screen } from '../..';
44
import '../../matchers/extend-expect';
55

66
const PLACEHOLDER_FRESHNESS = 'Add custom freshness';
@@ -202,3 +202,13 @@ test('error message renders the element tree, preserving only helpful props', as
202202
/>"
203203
`);
204204
});
205+
206+
test('supports unmanaged TextInput element', () => {
207+
render(<TextInput testID="input" />);
208+
209+
const input = screen.getByDisplayValue('');
210+
expect(input).toHaveDisplayValue('');
211+
212+
fireEvent.changeText(input, 'Hello!');
213+
expect(input).toHaveDisplayValue('Hello!');
214+
});

0 commit comments

Comments
 (0)