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,88 +10,97 @@ exports[`StandardHeader component renders correctly on Android 1`] = ` ...@@ -10,88 +10,97 @@ 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",
"flexDirection": "row",
"flexWrap": "wrap",
"height": 44,
"justifyContent": "flex-start",
} }
} }
> >
<View <View
accessible={true}
isTVSelectable={true}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={ style={
Object { Object {
"opacity": 1, "alignItems": "center",
"zIndex": 2, "backgroundColor": "#E62272",
"flexDirection": "row",
"flexWrap": "wrap",
"height": 44,
"justifyContent": "flex-start",
} }
} }
> >
<View
accessible={true}
isTVSelectable={true}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
"zIndex": 2,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": undefined,
"fontSize": 24,
},
Object {
"color": "#FFFFFF",
"paddingLeft": 10,
"paddingRight": 16,
},
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
<Text <Text
allowFontScaling={false}
style={ style={
Array [ Object {
Object { "color": "#FFFFFF",
"color": undefined, "fontFamily": "System",
"fontSize": 24, "fontSize": 18,
}, "fontWeight": "600",
Object { "left": 40,
"color": "#FFFFFF", "position": "absolute",
"paddingLeft": 10, "right": 40,
"paddingRight": 16, "textAlign": "center",
}, "zIndex": 0,
Object { }
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
} }
> >
ThaliApp
</Text> </Text>
</View> <View
<Text style={
style={ Object {
Object { "position": "absolute",
"color": "#FFFFFF", "right": 0,
"fontFamily": "System", }
"fontSize": 18,
"fontWeight": "600",
"left": 40,
"position": "absolute",
"right": 40,
"textAlign": "center",
"zIndex": 0,
}
}
>
ThaliApp
</Text>
<View
style={
Object {
"position": "absolute",
"right": 0,
} }
} />
/> </View>
</View> </RCTSafeAreaView>
</View> </View>
`; `;
...@@ -105,87 +114,96 @@ exports[`StandardHeader component renders correctly on iOS 1`] = ` ...@@ -105,87 +114,96 @@ 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",
"flexDirection": "row",
"flexWrap": "wrap",
"height": 44,
"justifyContent": "flex-start",
} }
} }
> >
<View <View
accessible={true}
isTVSelectable={true}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={ style={
Object { Object {
"opacity": 1, "alignItems": "center",
"zIndex": 2, "backgroundColor": "#E62272",
"flexDirection": "row",
"flexWrap": "wrap",
"height": 44,
"justifyContent": "flex-start",
} }
} }
> >
<View
accessible={true}
isTVSelectable={true}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"opacity": 1,
"zIndex": 2,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": undefined,
"fontSize": 24,
},
Object {
"color": "#FFFFFF",
"paddingLeft": 10,
"paddingRight": 16,
},
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
<Text <Text
allowFontScaling={false}
style={ style={
Array [ Object {
Object { "color": "#FFFFFF",
"color": undefined, "fontFamily": "System",
"fontSize": 24, "fontSize": 18,
}, "fontWeight": "600",
Object { "left": 40,
"color": "#FFFFFF", "position": "absolute",
"paddingLeft": 10, "right": 40,
"paddingRight": 16, "textAlign": "center",
}, "zIndex": 0,
Object { }
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
} }
> >
ThaliApp
</Text> </Text>
</View> <View
<Text style={
style={ Object {
Object { "position": "absolute",
"color": "#FFFFFF", "right": 0,
"fontFamily": "System", }
"fontSize": 18,
"fontWeight": "600",
"left": 40,
"position": "absolute",
"right": 40,
"textAlign": "center",
"zIndex": 0,
}
}
>
ThaliApp
</Text>
<View
style={
Object {
"position": "absolute",
"right": 0,
} }
} />
/> </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