Skip to content

Commit 58ea208

Browse files
committed
Remove unused mocks
1 parent 5c40a6f commit 58ea208

2 files changed

Lines changed: 7 additions & 87 deletions

File tree

packages/react-native-gesture-handler/src/__tests__/mocks.test.tsx

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,66 +20,8 @@ import {
2020

2121
import LegacyPressable from '../mocks/Pressable';
2222

23-
import {
24-
RawButton,
25-
BaseButton,
26-
RectButton,
27-
BorderlessButton,
28-
Clickable,
29-
ScrollView,
30-
FlatList,
31-
Switch,
32-
TextInput,
33-
RefreshControl,
34-
} from '../mocks/v3GestureComponents';
35-
36-
describe('Jest mocks – v3 components render without crashing', () => {
37-
test('RawButton', () => {
38-
expect(() => render(<RawButton />)).not.toThrow();
39-
});
40-
41-
test('BaseButton', () => {
42-
expect(() => render(<BaseButton />)).not.toThrow();
43-
});
44-
45-
test('RectButton', () => {
46-
expect(() => render(<RectButton />)).not.toThrow();
47-
});
48-
49-
test('BorderlessButton', () => {
50-
expect(() => render(<BorderlessButton />)).not.toThrow();
51-
});
52-
53-
test('Clickable', () => {
54-
expect(() => render(<Clickable />)).not.toThrow();
55-
});
56-
57-
test('Pressable (v3 shares legacy mock)', () => {
58-
expect(() => render(<LegacyPressable />)).not.toThrow();
59-
});
60-
61-
test('ScrollView', () => {
62-
expect(() => render(<ScrollView />)).not.toThrow();
63-
});
64-
65-
test('FlatList', () => {
66-
expect(() =>
67-
render(<FlatList data={[]} renderItem={() => null} />)
68-
).not.toThrow();
69-
});
70-
71-
test('Switch', () => {
72-
expect(() => render(<Switch />)).not.toThrow();
73-
});
74-
75-
test('TextInput', () => {
76-
expect(() => render(<TextInput />)).not.toThrow();
77-
});
78-
79-
test('RefreshControl', () => {
80-
expect(() => render(<RefreshControl refreshing={false} />)).not.toThrow();
81-
});
82-
});
23+
import GestureHandlerRootView from '../components/GestureHandlerRootView';
24+
import { Clickable } from '../v3/components';
8325

8426
describe('Jest mocks – legacy components render without crashing', () => {
8527
test('LegacyRawButton', () => {
@@ -134,9 +76,11 @@ describe('Jest mocks – legacy components render without crashing', () => {
13476
test('Trigger press by text', () => {
13577
const onPress = jest.fn();
13678
const { getByText } = render(
137-
<Clickable activeOpacity={0.3} onPress={onPress}>
138-
<Text>Press Me</Text>
139-
</Clickable>
79+
<GestureHandlerRootView>
80+
<Clickable activeOpacity={0.3} onPress={onPress}>
81+
<Text>Press Me</Text>
82+
</Clickable>
83+
</GestureHandlerRootView>
14084
);
14185

14286
fireEvent.press(getByText('Press Me'));

packages/react-native-gesture-handler/src/mocks/v3GestureComponents.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)