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
dce24805
Commit
dce24805
authored
Mar 26, 2018
by
Wietse Kuipers
Browse files
Merge branch 'feature/folder-structuring' into 'master'
Introduce new folder structure See merge request
!152
parents
c186be40
c818103d
Changes
107
Hide whitespace changes
Inline
Side-by-side
__mocks__/react-i18next-mock.js
0 → 100644
View file @
dce24805
/* global jest */
import
React
from
'
react
'
;
const
reacti18next
=
jest
.
genMockFromModule
(
'
react-i18next
'
);
const
translate
=
()
=>
Component
=>
props
=>
<
Component
t
=
{
s
=>
s
}
{...
props
}
/>
;
reacti18next
.
translate
=
translate
;
module
.
exports
=
reacti18next
;
__tests__/sagas/calendar.spec.js
View file @
dce24805
...
...
@@ -3,13 +3,13 @@ import { expectSaga } from 'redux-saga-test-plan';
import
*
as
matchers
from
'
redux-saga-test-plan/matchers
'
;
import
{
throwError
}
from
'
redux-saga-test-plan/providers
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
calendarSaga
from
'
../../app/sagas/calendar
'
;
import
*
as
calendarActions
from
'
../../app/actions/calendar
'
;
import
*
as
navActions
from
'
../../app/actions/navigation
'
;
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/deepLinking.spec.js
View file @
dce24805
...
...
@@ -3,7 +3,7 @@ import { select } from 'redux-saga/effects';
import
{
expectSaga
}
from
'
redux-saga-test-plan
'
;
import
deepLinkingSaga
,
{
parseURL
}
from
'
../../app/sagas/deepLinking
'
;
import
*
as
deepLinkingActions
from
'
../../app/actions/deepLinking
'
;
import
{
url
as
siteURL
,
apiRequest
,
loggedInSelector
}
from
'
../../app/url
'
;
import
{
url
as
siteURL
,
apiRequest
,
loggedInSelector
}
from
'
../../app/
utils/
url
'
;
import
*
as
navigationActions
from
'
../../app/actions/navigation
'
;
import
*
as
eventActions
from
'
../../app/actions/event
'
;
import
*
as
loginActions
from
'
../../app/actions/login
'
;
...
...
__tests__/sagas/event.spec.js
View file @
dce24805
...
...
@@ -3,13 +3,13 @@ import { expectSaga } from 'redux-saga-test-plan';
import
*
as
matchers
from
'
redux-saga-test-plan/matchers
'
;
import
{
throwError
}
from
'
redux-saga-test-plan/providers
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
eventSaga
from
'
../../app/sagas/event
'
;
import
*
as
eventActions
from
'
../../app/actions/event
'
;
import
*
as
navActions
from
'
../../app/actions/navigation
'
;
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/login.spec.js
View file @
dce24805
...
...
@@ -5,7 +5,7 @@ import Snackbar from 'react-native-snackbar';
import
{
AsyncStorage
}
from
'
react-native
'
;
import
loginSaga
,
{
DISPLAYNAMEKEY
,
PHOTOKEY
,
TOKENKEY
,
USERNAMEKEY
}
from
'
../../app/sagas/login
'
;
import
{
apiRequest
}
from
'
../../app/url
'
;
import
{
apiRequest
}
from
'
../../app/
utils/
url
'
;
import
*
as
loginActions
from
'
../../app/actions/login
'
;
import
*
as
pushNotificationsActions
from
'
../../app/actions/pushNotifications
'
;
...
...
@@ -22,7 +22,7 @@ jest.mock('react-native', () => ({
},
}));
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/pizza.spec.js
View file @
dce24805
...
...
@@ -2,12 +2,12 @@ import * as matchers from 'redux-saga-test-plan/matchers';
import
{
select
}
from
'
redux-saga/effects
'
;
import
{
expectSaga
}
from
'
redux-saga-test-plan
'
;
import
{
throwError
}
from
'
redux-saga-test-plan/providers
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
pizzaSaga
from
'
../../app/sagas/pizza
'
;
import
*
as
pizzaActions
from
'
../../app/actions/pizza
'
;
import
*
as
navigationActions
from
'
../../app/actions/navigation
'
;
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/profile.spec.js
View file @
dce24805
...
...
@@ -3,11 +3,11 @@ import { expectSaga } from 'redux-saga-test-plan';
import
*
as
matchers
from
'
redux-saga-test-plan/matchers
'
;
import
{
throwError
}
from
'
redux-saga-test-plan/providers
'
;
import
profileSaga
from
'
../../app/sagas/profile
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
*
as
profileActions
from
'
../../app/actions/profile
'
;
import
*
as
navActions
from
'
../../app/actions/navigation
'
;
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/pushNotifications.spec.js
View file @
dce24805
...
...
@@ -4,10 +4,10 @@ import * as matchers from 'redux-saga-test-plan/matchers';
import
{
Platform
}
from
'
react-native
'
;
import
FCM
from
'
react-native-fcm
'
;
import
pushNotificationsSaga
from
'
../../app/sagas/pushNotifications
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
*
as
pushActions
from
'
../../app/actions/pushNotifications
'
;
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/registration.spec.js
View file @
dce24805
...
...
@@ -5,7 +5,7 @@ import Snackbar from 'react-native-snackbar';
import
{
select
}
from
'
redux-saga/effects
'
;
import
*
as
registrationActions
from
'
../../app/actions/registration
'
;
import
registrationSaga
,
{
eventSelector
}
from
'
../../app/sagas/registration
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
*
as
eventActions
from
'
../../app/actions/event
'
;
import
*
as
navigationActions
from
'
../../app/actions/navigation
'
;
...
...
@@ -15,7 +15,7 @@ jest.mock('react-native-snackbar', () => ({
dismiss
:
jest
.
fn
(),
}));
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/sagas/welcome.spec.js
View file @
dce24805
...
...
@@ -3,10 +3,10 @@ import { expectSaga } from 'redux-saga-test-plan';
import
*
as
matchers
from
'
redux-saga-test-plan/matchers
'
;
import
{
throwError
}
from
'
redux-saga-test-plan/providers
'
;
import
welcomeSaga
from
'
../../app/sagas/welcome
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/url
'
;
import
{
apiRequest
,
tokenSelector
}
from
'
../../app/
utils/
url
'
;
import
*
as
welcomeActions
from
'
../../app/actions/welcome
'
;
jest
.
mock
(
'
../../app/url
'
,
()
=>
({
jest
.
mock
(
'
../../app/
utils/
url
'
,
()
=>
({
apiRequest
:
jest
.
fn
(()
=>
{}),
tokenSelector
:
()
=>
'
token
'
,
}));
...
...
__tests__/ui/components/button/Button.spec.js
0 → 100644
View file @
dce24805
import
React
from
'
react
'
;
import
{
Platform
}
from
'
react-native
'
;
import
renderer
from
'
react-test-renderer
'
;
import
Button
from
'
../../../../app/ui/components/button/Button
'
;
describe
(
'
Button component
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
Button
title
=
"
title
"
onPress
=
{()
=>
{}}
/>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
it
(
'
renders disabled correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
Button
title
=
"
title
"
disabled
onPress
=
{()
=>
{}}
/>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
it
(
'
renders title correctly on Android
'
,
()
=>
{
Platform
.
OS
=
'
android
'
;
const
tree
=
renderer
.
create
(
<
Button
title
=
"
title
"
onPress
=
{()
=>
{}}
/>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
});
\ No newline at end of file
__tests__/ui/components/button/__snapshots__/Button.spec.js.snap
0 → 100644
View file @
dce24805
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Button component renders correctly 1`] = `
<View
accessibilityComponentType={undefined}
accessibilityLabel={undefined}
accessibilityTraits={undefined}
accessible={true}
hasTVPreferredFocus={undefined}
hitSlop={undefined}
isTVSelectable={true}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
undefined,
Object {
"borderRadius": 100,
},
]
}
testID={undefined}
tvParallaxProperties={undefined}
>
<View
style={
Array [
Object {
"borderRadius": 100,
"padding": 10,
"paddingLeft": 12,
"paddingRight": 12,
},
Object {
"backgroundColor": "#E62272",
},
]
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Array [
Object {
"color": "#FFFFFF",
"fontSize": 14,
"justifyContent": "center",
"textAlign": "center",
},
Object {},
]
}
>
title
</Text>
</View>
</View>
`;
exports[`Button component renders disabled correctly 1`] = `
<View
accessibilityComponentType={undefined}
accessibilityLabel={undefined}
accessibilityTraits={undefined}
accessible={true}
hasTVPreferredFocus={undefined}
hitSlop={undefined}
isTVSelectable={true}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
undefined,
Object {
"borderRadius": 100,
},
Object {
"opacity": 0.8,
},
]
}
testID={undefined}
tvParallaxProperties={undefined}
>
<View
style={
Array [
Object {
"borderRadius": 100,
"padding": 10,
"paddingLeft": 12,
"paddingRight": 12,
},
Object {
"backgroundColor": "#E62272",
},
]
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Array [
Object {
"color": "#FFFFFF",
"fontSize": 14,
"justifyContent": "center",
"textAlign": "center",
},
Object {},
]
}
>
title
</Text>
</View>
</View>
`;
exports[`Button component renders title correctly on Android 1`] = `
<View
accessibilityComponentType={undefined}
accessibilityLabel={undefined}
accessibilityTraits={undefined}
accessible={true}
hasTVPreferredFocus={undefined}
hitSlop={undefined}
isTVSelectable={true}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
undefined,
Object {
"borderRadius": 100,
},
]
}
testID={undefined}
tvParallaxProperties={undefined}
>
<View
style={
Array [
Object {
"borderRadius": 100,
"padding": 10,
"paddingLeft": 12,
"paddingRight": 12,
},
Object {
"backgroundColor": "#E62272",
},
]
}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Array [
Object {
"color": "#FFFFFF",
"fontSize": 14,
"justifyContent": "center",
"textAlign": "center",
},
Object {},
]
}
>
TITLE
</Text>
</View>
</View>
`;
__tests__/ui/components/dismissKeyboardView/DismissKeyboardView.spec.js
0 → 100644
View file @
dce24805
import
React
from
'
react
'
;
import
{
Text
}
from
'
react-native
'
;
import
renderer
from
'
react-test-renderer
'
;
import
DismissKeyboardView
from
'
../../../../app/ui/components/dismissKeyboardView/DismissKeyboardView
'
;
describe
(
'
DismissKeyboardView component
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
DismissKeyboardView
><
Text
>
Text
<
/Text></
DismissKeyboardView
>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
});
\ No newline at end of file
__tests__/ui/components/dismissKeyboardView/__snapshots__/DismissKeyboardView.spec.js.snap
0 → 100644
View file @
dce24805
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DismissKeyboardView component renders correctly 1`] = `
<View
accessibilityComponentType={undefined}
accessibilityLabel={undefined}
accessibilityTraits={undefined}
accessible={false}
hitSlop={undefined}
nativeID={undefined}
onLayout={undefined}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={Object {}}
testID={undefined}
>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
>
Text
</Text>
</View>
`;
__tests__/ui/components/errorScreen/ErrorScreen.spec.js
0 → 100644
View file @
dce24805
import
React
from
'
react
'
;
import
renderer
from
'
react-test-renderer
'
;
import
ErrorScreen
from
'
../../../../app/ui/components/errorScreen/ErrorScreen
'
;
describe
(
'
ErrorScreen component
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
ErrorScreen
message
=
"
Lorem ipsum
"
/>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
});
__tests__/ui/components/errorScreen/__snapshots__/ErrorScreen.spec.js.snap
0 → 100644
View file @
dce24805
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ErrorScreen component renders correctly 1`] = `
<View
style={
Object {
"alignItems": "center",
"backgroundColor": "#FAFAFA",
"flex": 1,
"justifyContent": "center",
}
}
>
<Image
source={
Object {
"testUri": "../../../app/assets/img/sad_cloud.png",
}
}
style={
Object {
"height": 200,
"marginBottom": 32,
"resizeMode": "contain",
"width": 200,
}
}
/>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Object {
"color": "#616161",
"fontFamily": "System",
"fontSize": 16,
"fontWeight": "500",
"textAlign": "center",
}
}
>
Lorem ipsum
</Text>
<Text
accessible={true}
allowFontScaling={true}
ellipsizeMode="tail"
style={
Object {
"color": "#616161",
"fontFamily": "System",
"fontSize": 16,
"fontWeight": "500",
"textAlign": "center",
}
}
>
Try again later.
</Text>
</View>
`;
__tests__/ui/components/loadingScreen/LoadingScreen.spec.js
0 → 100644
View file @
dce24805
import
React
from
'
react
'
;
import
renderer
from
'
react-test-renderer
'
;
import
LoadingScreen
from
'
../../../../app/ui/components/loadingScreen/LoadingScreen
'
;
describe
(
'
LoadingScreen component
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
LoadingScreen
/>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
});
\ No newline at end of file
__tests__/ui/components/loadingScreen/__snapshots__/LoadingScreen.spec.js.snap
0 → 100644
View file @
dce24805
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`LoadingScreen component renders correctly 1`] = `
<View
style={
Object {
"alignItems": "center",
"flex": 1,
"justifyContent": "center",
}
}
>
<ActivityIndicator
animating={true}
color="#E62272"
hidesWhenStopped={true}
size="large"
/>
</View>
`;
__tests__/ui/components/memberView/MemberView.spec.js
0 → 100644
View file @
dce24805
import
React
from
'
react
'
;
import
renderer
from
'
react-test-renderer
'
;
import
configureStore
from
'
redux-mock-store
'
import
MemberView
from
'
../../../../app/ui/components/memberView/MemberView
'
;
import
reducer
from
'
../../../../app/reducers/index
'
;
describe
(
'
MemberView component
'
,
()
=>
{
const
mockStore
=
configureStore
(
reducer
);
const
initialState
=
{
session
:
{
token
:
'
token123
'
,
},
};
const
store
=
mockStore
(
initialState
);
const
member
=
{
pk
:
1
,
name
:
'
Lorem ipsum
'
,
photo
:
'
http://example.org/example.png
'
,
};
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
MemberView
store
=
{
store
}
member
=
{
member
}
size
=
{
20
}
/>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
});
\ No newline at end of file
__tests__/ui/components/memberView/SquareView.spec.js
0 → 100644
View file @
dce24805
import
React
from
'
react
'
;
import
{
View
}
from
'
react-native
'
;
import
renderer
from
'
react-test-renderer
'
;
import
SquareView
from
'
../../../../app/ui/components/memberView/SquareView
'
;
describe
(
'
SquareView component
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
const
tree
=
renderer
.
create
(
<
SquareView
size
=
{
20
}
><
View
/><
/SquareView>
)
.
toJSON
();
expect
(
tree
).
toMatchSnapshot
();
});
});
\ No newline at end of file
Prev
1
2
3
4
5
6
Next
Write
Preview
Supports
Markdown
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