Skip to content

Commit 6eb071a

Browse files
author
Damian Sznajder
committed
refactor: move & remove duplicated tests after merge
1 parent ff10a3a commit 6eb071a

File tree

3 files changed

+0
-260
lines changed

3 files changed

+0
-260
lines changed

src/__tests__/findByApi.test.js

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

src/__tests__/getByApi.test.js

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,6 @@ import React from 'react';
33
import { View, Text, TextInput, Button } from 'react-native';
44
import { render, getDefaultNormalizer } from '..';
55

6-
const MyComponent = () => {
7-
return <Text>My Component</Text>;
8-
};
9-
10-
test('getByTestId returns only native elements', () => {
11-
const { getByTestId, getAllByTestId } = render(
12-
<View>
13-
<Text testID="text">Text</Text>
14-
<TextInput testID="textInput" />
15-
<View testID="view" />
16-
<Button testID="button" title="Button" onPress={jest.fn()} />
17-
<MyComponent testID="myComponent" />
18-
</View>
19-
);
20-
21-
expect(getByTestId('text')).toBeTruthy();
22-
expect(getByTestId('textInput')).toBeTruthy();
23-
expect(getByTestId('view')).toBeTruthy();
24-
expect(getByTestId('button')).toBeTruthy();
25-
26-
expect(getAllByTestId('text')).toHaveLength(1);
27-
expect(getAllByTestId('textInput')).toHaveLength(1);
28-
expect(getAllByTestId('view')).toHaveLength(1);
29-
expect(getAllByTestId('button')).toHaveLength(1);
30-
31-
expect(() => getByTestId('myComponent')).toThrowError(
32-
'Unable to find an element with testID: myComponent'
33-
);
34-
expect(() => getAllByTestId('myComponent')).toThrowError(
35-
'Unable to find an element with testID: myComponent'
36-
);
37-
});
38-
39-
test('supports a regex matcher', () => {
40-
const { getByTestId, getAllByTestId } = render(
41-
<View>
42-
<Text testID="text">Text</Text>
43-
<TextInput testID="textInput" />
44-
<View testID="view" />
45-
<Button testID="button" title="Button" onPress={jest.fn()} />
46-
<MyComponent testID="myComponent" />
47-
</View>
48-
);
49-
50-
expect(getByTestId(/view/)).toBeTruthy();
51-
expect(getAllByTestId(/text/)).toHaveLength(2);
52-
});
53-
546
describe('Supports a TextMatch options', () => {
557
test('getByText, getAllByText', () => {
568
const { getByText, getAllByText } = render(

src/__tests__/queryByApi.test.js

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

0 commit comments

Comments
 (0)