Newer
Older
import 'react-native';
import React from 'react';
import Profile from '../Components/Profile';
import App from '../App'
import renderer from 'react-test-renderer';
import Loading from '../Components/Loading';
import Repo from '../Components/Repo';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import Unfound from '../Components/Unfound';
const tree = renderer.create(
<Loading />
).toJSON();
expect(tree).toMatchSnapshot();
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
});
test('renders correctly', ({navigation}) => {
const dataFile = {
iconUrl: "https://avatars.githubusercontent.com/u/42978932?u=b4a7beb2752bb6059cd13d12ca26d097767abf77&v=4",
nameContent: null,
userNameContent: null,
bioContent: null,
websiteLink: null,
emailContent: null,
createData: null,
repoCount: 0,
navi: navigation
}
const tree = renderer.create(
<Profile data={dataFile}/>
).toJSON();
expect(tree).toMatchSnapshot();
});
test('renders correctly', ({navigation}) => {
const dataFile = {
iconUrl: "https://avatars.githubusercontent.com/u/42978932?u=b4a7beb2752bb6059cd13d12ca26d097767abf77&v=4",
nameContent: null,
userNameContent: null,
bioContent: null,
websiteLink: null,
emailContent: null,
createData: null,
repoCount: 0,
navi: navigation
}
const tree = renderer.create(
<Repo data={dataFile}/>
).toJSON();
expect(tree).toMatchSnapshot();
});
test('renders correctly', ({navigation}) => {
const dataFile = {
navi: navigation
}
const tree = renderer.create(
<Unfound data={dataFile}/>
).toJSON();
expect(tree).toMatchSnapshot();