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 Stack = createStackNavigator();

test('renders correctly', () => {
    const tree = renderer.create(
      <Loading />
    ).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(
      <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();
  });