Fakultas Ilmu Komputer UI

Commit 24bc1808 authored by jahnsmichael's avatar jahnsmichael
Browse files

[RED] ProfilePage scenes

parent 49936b3b
......@@ -3,22 +3,39 @@ import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import ReactTestRenderer, { act } from 'react-test-renderer';
import ReactTestRenderer from 'react-test-renderer';
import ProfilePage from '.';
import { AppContext } from 'contexts';
import { useMainService } from 'services';
const Stack = createStackNavigator();
const testProps = {
services: {
main: useMainService('dummyToken'),
},
user : {
name: "test name",
username: "testusername",
email: "test@email.com",
phone_number: "0123456789",
district: "Tapos",
sub_district: "Sukatani",
},
cache: {},
}
it('renders correctly', () => {
const instance = ReactTestRenderer.create(
<NavigationContainer>
<Stack.Navigator
screenOptions={{
header: () => <></>,
}}>
<Stack.Screen name="profile" component={ProfilePage} />
</Stack.Navigator>
</NavigationContainer>,
<AppContext.Provider value={testProps}>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
header: () => <></>,
}}>
<Stack.Screen name="profile" component={ProfilePage} />
</Stack.Navigator>
</NavigationContainer>,
</AppContext.Provider>
);
expect(instance.toJSON()).toMatchSnapshot();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment