Skip to content

Commit 564b973

Browse files
ShaswatPrabhatmdjastrzebski
authored andcommitted
Move Hinttext tests to hintText.test.tsx
1 parent 4466d73 commit 564b973

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/queries/__tests__/hintText.test.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { TouchableOpacity, Text } from 'react-native';
2+
import { TouchableOpacity, Text, View } from 'react-native';
33
import { render } from '../..';
44

55
const BUTTON_HINT = 'click this button';
@@ -84,3 +84,25 @@ test('getAllByA11yHint, queryAllByA11yHint, findAllByA11yHint', async () => {
8484
getNoInstancesFoundMessage(NO_MATCHES_TEXT)
8585
);
8686
});
87+
88+
test('getByHintText, getByHintText', () => {
89+
const { getByHintText, getAllByHintText } = render(
90+
<View>
91+
<View accessibilityHint="test" />
92+
<View accessibilityHint="tests id" />
93+
</View>
94+
);
95+
expect(getByHintText('id', { exact: false })).toBeTruthy();
96+
expect(getAllByHintText('test', { exact: false })).toHaveLength(2);
97+
});
98+
99+
test('getByHintText, getByHintText and exact = true', () => {
100+
const { queryByHintText, getAllByHintText } = render(
101+
<View>
102+
<View accessibilityHint="test" />
103+
<View accessibilityHint="tests id" />
104+
</View>
105+
);
106+
expect(queryByHintText('id', { exact: true })).toBeNull();
107+
expect(getAllByHintText('test', { exact: true })).toHaveLength(1);
108+
});

src/queries/__tests__/text.test.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -342,28 +342,6 @@ describe('supports TextMatch options', () => {
342342
expect(getAllByTestId('test', { exact: false })).toHaveLength(2);
343343
});
344344

345-
test('getByHintText, getByHintText', () => {
346-
const { getByHintText, getAllByHintText } = render(
347-
<View>
348-
<View accessibilityHint="test" />
349-
<View accessibilityHint="tests id" />
350-
</View>
351-
);
352-
expect(getByHintText('id', { exact: false })).toBeTruthy();
353-
expect(getAllByHintText('test', { exact: false })).toHaveLength(2);
354-
});
355-
356-
test('getByHintText, getByHintText and exact = true', () => {
357-
const { queryByHintText, getAllByHintText } = render(
358-
<View>
359-
<View accessibilityHint="test" />
360-
<View accessibilityHint="tests id" />
361-
</View>
362-
);
363-
expect(queryByHintText('id', { exact: true })).toBeNull();
364-
expect(getAllByHintText('test', { exact: true })).toHaveLength(1);
365-
});
366-
367345
test('with TextMatch option exact === false text search is NOT case sensitive', () => {
368346
const { getByText, getAllByText } = render(
369347
<View>

0 commit comments

Comments
 (0)