Skip to content

Commit 8b8c135

Browse files
committed
chore: remove irrelevant tests
1 parent 9e7b1ab commit 8b8c135

File tree

2 files changed

+0
-100
lines changed

2 files changed

+0
-100
lines changed

src/__tests__/fire-event.test.tsx

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,6 @@ const WithoutEventComponent = (_props: WithoutEventComponentProps) => (
3030
</View>
3131
);
3232

33-
// type CustomEventComponentProps = {
34-
// onCustomEvent: () => void;
35-
// };
36-
37-
// const CustomEventComponent = ({ onCustomEvent }: CustomEventComponentProps) => (
38-
// <TouchableOpacity onPress={onCustomEvent}>
39-
// <Text>Custom event component</Text>
40-
// </TouchableOpacity>
41-
// );
42-
43-
// type MyCustomButtonProps = {
44-
// handlePress: () => void;
45-
// text: string;
46-
// };
47-
48-
// const MyCustomButton = ({ handlePress, text }: MyCustomButtonProps) => (
49-
// <OnPressComponent onPress={handlePress} text={text} />
50-
// );
51-
52-
// type CustomEventComponentWithCustomNameProps = {
53-
// handlePress: () => void;
54-
// };
55-
56-
// const CustomEventComponentWithCustomName = ({
57-
// handlePress,
58-
// }: CustomEventComponentWithCustomNameProps) => (
59-
// <MyCustomButton handlePress={handlePress} text="Custom component" />
60-
// );
61-
6233
describe('fireEvent', () => {
6334
test('should invoke specified event', () => {
6435
const onPressMock = jest.fn();
@@ -87,21 +58,6 @@ describe('fireEvent', () => {
8758
fireEvent(screen.getByText('Without event'), 'press');
8859
expect(onPressMock).not.toHaveBeenCalled();
8960
});
90-
91-
// test('should invoke event with custom name', () => {
92-
// const handlerMock = jest.fn();
93-
// const EVENT_DATA = 'event data';
94-
95-
// render(
96-
// <View>
97-
// <CustomEventComponent onCustomEvent={handlerMock} />
98-
// </View>,
99-
// );
100-
101-
// fireEvent(screen.getByText('Custom event component'), 'customEvent', EVENT_DATA);
102-
103-
// expect(handlerMock).toHaveBeenCalledWith(EVENT_DATA);
104-
// });
10561
});
10662

10763
test('fireEvent.press', () => {
@@ -166,26 +122,6 @@ it('sets native state value for unmanaged text inputs', () => {
166122
expect(input).toHaveDisplayValue('abc');
167123
});
168124

169-
// test('custom component with custom event name', () => {
170-
// const handlePress = jest.fn();
171-
172-
// render(<CustomEventComponentWithCustomName handlePress={handlePress} />);
173-
174-
// fireEvent(screen.getByText('Custom component'), 'handlePress');
175-
176-
// expect(handlePress).toHaveBeenCalled();
177-
// });
178-
179-
// test('event with multiple handler parameters', () => {
180-
// const handlePress = jest.fn();
181-
182-
// render(<CustomEventComponentWithCustomName handlePress={handlePress} />);
183-
184-
// fireEvent(screen.getByText('Custom component'), 'handlePress', 'param1', 'param2');
185-
186-
// expect(handlePress).toHaveBeenCalledWith('param1', 'param2');
187-
// });
188-
189125
test('should not fire on disabled TouchableOpacity', () => {
190126
const handlePress = jest.fn();
191127
render(

src/__tests__/render.test.tsx

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,42 +74,6 @@ class Banana extends React.Component<any, { fresh: boolean }> {
7474
}
7575
}
7676

77-
// test('UNSAFE_getAllByType, UNSAFE_queryAllByType', () => {
78-
// render(<Banana />);
79-
// const [text, status, button] = screen.UNSAFE_getAllByType(Text);
80-
// const InExistent = () => null;
81-
82-
// expect(text.props.children).toBe('Is the banana fresh?');
83-
// expect(status.props.children).toBe('not fresh');
84-
// expect(button.props.children).toBe('Change freshness!');
85-
// expect(() => screen.UNSAFE_getAllByType(InExistent)).toThrow('No instances found');
86-
87-
// expect(screen.UNSAFE_queryAllByType(Text)[1]).toBe(status);
88-
// expect(screen.UNSAFE_queryAllByType(InExistent)).toHaveLength(0);
89-
// });
90-
91-
// test('UNSAFE_getByProps, UNSAFE_queryByProps', () => {
92-
// render(<Banana />);
93-
// const primaryType = screen.UNSAFE_getByProps({ type: 'primary' });
94-
95-
// expect(primaryType.props.children).toBe('Change freshness!');
96-
// expect(() => screen.UNSAFE_getByProps({ type: 'inexistent' })).toThrow('No instances found');
97-
98-
// expect(screen.UNSAFE_queryByProps({ type: 'primary' })).toBe(primaryType);
99-
// expect(screen.UNSAFE_queryByProps({ type: 'inexistent' })).toBeNull();
100-
// });
101-
102-
// test('UNSAFE_getAllByProp, UNSAFE_queryAllByProps', () => {
103-
// render(<Banana />);
104-
// const primaryTypes = screen.UNSAFE_getAllByProps({ type: 'primary' });
105-
106-
// expect(primaryTypes).toHaveLength(1);
107-
// expect(() => screen.UNSAFE_getAllByProps({ type: 'inexistent' })).toThrow('No instances found');
108-
109-
// expect(screen.UNSAFE_queryAllByProps({ type: 'primary' })).toEqual(primaryTypes);
110-
// expect(screen.UNSAFE_queryAllByProps({ type: 'inexistent' })).toHaveLength(0);
111-
// });
112-
11377
test('update', () => {
11478
const fn = jest.fn();
11579
render(<Banana onUpdate={fn} />);

0 commit comments

Comments
 (0)