Verified Commit aa64df30 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix tests

parent dbfb6cb5
...@@ -3,8 +3,8 @@ import React from 'react'; ...@@ -3,8 +3,8 @@ import React from 'react';
const reacti18next = jest.genMockFromModule('react-i18next'); const reacti18next = jest.genMockFromModule('react-i18next');
const translate = () => Component => props => <Component t={s => s} {...props} />; const withTranslation = () => Component => props => <Component t={s => s} {...props} />;
reacti18next.translate = translate; reacti18next.withTranslation = withTranslation;
module.exports = reacti18next; module.exports = reacti18next;
...@@ -7,3 +7,7 @@ NativeModules.RNFirebase = { ...@@ -7,3 +7,7 @@ NativeModules.RNFirebase = {
NativeModules.RNShare = { NativeModules.RNShare = {
}; };
jest.mock('react-native-device-info', () => ({
hasNotch: () => false,
}));
...@@ -10,14 +10,22 @@ exports[`StandardHeader component renders correctly on Android 1`] = ` ...@@ -10,14 +10,22 @@ exports[`StandardHeader component renders correctly on Android 1`] = `
} }
} }
/> />
<View <RCTSafeAreaView
emulateUnlessSupported={true}
style={ style={
Object { Object {
"alignItems": "center",
"backgroundColor": "#E62272", "backgroundColor": "#E62272",
"borderBottomColor": "#C2185B", "borderBottomColor": "#C2185B",
"borderBottomWidth": 1, "borderBottomWidth": 1,
"borderStyle": "solid", "borderStyle": "solid",
}
}
>
<View
style={
Object {
"alignItems": "center",
"backgroundColor": "#E62272",
"flexDirection": "row", "flexDirection": "row",
"flexWrap": "wrap", "flexWrap": "wrap",
"height": 44, "height": 44,
...@@ -92,6 +100,7 @@ exports[`StandardHeader component renders correctly on Android 1`] = ` ...@@ -92,6 +100,7 @@ exports[`StandardHeader component renders correctly on Android 1`] = `
} }
/> />
</View> </View>
</RCTSafeAreaView>
</View> </View>
`; `;
...@@ -105,14 +114,22 @@ exports[`StandardHeader component renders correctly on iOS 1`] = ` ...@@ -105,14 +114,22 @@ exports[`StandardHeader component renders correctly on iOS 1`] = `
} }
} }
/> />
<View <RCTSafeAreaView
emulateUnlessSupported={true}
style={ style={
Object { Object {
"alignItems": "center",
"backgroundColor": "#E62272", "backgroundColor": "#E62272",
"borderBottomColor": "#C2185B", "borderBottomColor": "#C2185B",
"borderBottomWidth": 1, "borderBottomWidth": 1,
"borderStyle": "solid", "borderStyle": "solid",
}
}
>
<View
style={
Object {
"alignItems": "center",
"backgroundColor": "#E62272",
"flexDirection": "row", "flexDirection": "row",
"flexWrap": "wrap", "flexWrap": "wrap",
"height": 44, "height": 44,
...@@ -187,5 +204,6 @@ exports[`StandardHeader component renders correctly on iOS 1`] = ` ...@@ -187,5 +204,6 @@ exports[`StandardHeader component renders correctly on iOS 1`] = `
} }
/> />
</View> </View>
</RCTSafeAreaView>
</View> </View>
`; `;
...@@ -2,7 +2,7 @@ import i18n from '../../app/utils/i18n'; ...@@ -2,7 +2,7 @@ import i18n from '../../app/utils/i18n';
jest.mock('react-i18next', () => ({ jest.mock('react-i18next', () => ({
reactI18nextModule: {}, initReactI18next: {},
})); }));
describe('i18n helper', () => { describe('i18n helper', () => {
......
import React from 'react'; import React from 'react';
import { import {
StatusBar, Text, TouchableOpacity, View, SafeAreaView StatusBar, Text, TouchableOpacity, View, SafeAreaView,
} from 'react-native'; } from 'react-native';
import { withTranslation } from 'react-i18next'; import { withTranslation } from 'react-i18next';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
......
import locale from 'react-native-locale-detector'; import locale from 'react-native-locale-detector';
let server = 'https://staging.thalia.nu'; let server = 'https://thalia.nu';
/* istanbul ignore next line */ /* istanbul ignore next line */
if (__DEV__) { // eslint-disable-line no-undef if (__DEV__) { // eslint-disable-line no-undef
// server = 'http://localhost:8000'; server = 'http://localhost:8000';
} }
export const url = server; export const url = server;
......
Markdown is supported
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