Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
aa64df30
Verified
Commit
aa64df30
authored
May 29, 2019
by
Sébastiaan Versteeg
Browse files
Fix tests
parent
dbfb6cb5
Changes
6
Hide whitespace changes
Inline
Side-by-side
__mocks__/react-i18next-mock.js
View file @
aa64df30
...
...
@@ -3,8 +3,8 @@ import React from 'react';
const
reacti18next
=
jest
.
genMockFromModule
(
'
react-i18next
'
);
const
t
ranslat
e
=
()
=>
Component
=>
props
=>
<
Component
t
=
{
s
=>
s
}
{...
props
}
/>
;
const
withT
ranslat
ion
=
()
=>
Component
=>
props
=>
<
Component
t
=
{
s
=>
s
}
{...
props
}
/>
;
reacti18next
.
t
ranslat
e
=
t
ranslat
e
;
reacti18next
.
withT
ranslat
ion
=
withT
ranslat
ion
;
module
.
exports
=
reacti18next
;
__tests__/setup.js
View file @
aa64df30
...
...
@@ -7,3 +7,7 @@ NativeModules.RNFirebase = {
NativeModules
.
RNShare
=
{
};
jest
.
mock
(
'
react-native-device-info
'
,
()
=>
({
hasNotch
:
()
=>
false
,
}));
__tests__/ui/components/standardHeader/__snapshots__/StandardHeader.spec.js.snap
View file @
aa64df30
...
...
@@ -10,88 +10,97 @@ exports[`StandardHeader component renders correctly on Android 1`] = `
}
}
/>
<View
<RCTSafeAreaView
emulateUnlessSupported={true}
style={
Object {
"alignItems": "center",
"backgroundColor": "#E62272",
"borderBottomColor": "#C2185B",
"borderBottomWidth": 1,
"borderStyle": "solid",
"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,
"alignItems": "center",
"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
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 {},
]
Object {
"color": "#FFFFFF",
"fontFamily": "System",
"fontSize": 18,
"fontWeight": "600",
"left": 40,
"position": "absolute",
"right": 40,
"textAlign": "center",
"zIndex": 0,
}
}
>
ThaliApp
</Text>
</View>
<Text
style={
Object {
"color": "#FFFFFF",
"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
style={
Object {
"position": "absolute",
"right": 0,
}
}
}
/
>
</View>
/>
</View
>
</
RCTSafeArea
View>
</View>
`;
...
...
@@ -105,87 +114,96 @@ exports[`StandardHeader component renders correctly on iOS 1`] = `
}
}
/>
<View
<RCTSafeAreaView
emulateUnlessSupported={true}
style={
Object {
"alignItems": "center",
"backgroundColor": "#E62272",
"borderBottomColor": "#C2185B",
"borderBottomWidth": 1,
"borderStyle": "solid",
"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,
"alignItems": "center",
"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
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 {},
]
Object {
"color": "#FFFFFF",
"fontFamily": "System",
"fontSize": 18,
"fontWeight": "600",
"left": 40,
"position": "absolute",
"right": 40,
"textAlign": "center",
"zIndex": 0,
}
}
>
ThaliApp
</Text>
</View>
<Text
style={
Object {
"color": "#FFFFFF",
"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
style={
Object {
"position": "absolute",
"right": 0,
}
}
}
/
>
</View>
/>
</View
>
</
RCTSafeArea
View>
</View>
`;
__tests__/utils/i18n.spec.js
View file @
aa64df30
...
...
@@ -2,7 +2,7 @@ import i18n from '../../app/utils/i18n';
jest
.
mock
(
'
react-i18next
'
,
()
=>
({
r
eactI18next
Module
:
{},
initR
eactI18next
:
{},
}));
describe
(
'
i18n helper
'
,
()
=>
{
...
...
app/ui/components/standardHeader/StandardHeader.js
View file @
aa64df30
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
'
;
...
...
app/utils/url.js
View file @
aa64df30
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment