Fakultas Ilmu Komputer UI

index.test.tsx 716 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import 'react-native';
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';

import ReactTestRenderer, { act } from 'react-test-renderer';
import ProfilePage from '.';
import { AppContext } from 'contexts';

const Stack = createStackNavigator();

it('renders correctly', () => {
  const instance = ReactTestRenderer.create(
    <NavigationContainer>
      <Stack.Navigator
        screenOptions={{
          header: () => <></>,
        }}>
        <Stack.Screen name="profile" component={ProfilePage} />
      </Stack.Navigator>
    </NavigationContainer>,
  );

  expect(instance.toJSON()).toMatchSnapshot();
});