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