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

Fix problems

parent c1c8e62f
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
"plugins": [ "plugins": [
"@babel/plugin-proposal-object-rest-spread", "@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-transform-regenerator", "@babel/plugin-transform-regenerator",
"@babel/plugin-transform-runtime" "@babel/plugin-transform-runtime"
] ]
......
...@@ -63,4 +63,4 @@ build android: ...@@ -63,4 +63,4 @@ build android:
paths: paths:
- $CI_PROJECT_DIR/android/app/build/outputs/apk/debug/app-debug.apk - $CI_PROJECT_DIR/android/app/build/outputs/apk/debug/app-debug.apk
- $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release-unsigned.apk - $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release-unsigned.apk
- $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release.apk - $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release.apk
\ No newline at end of file
import React from 'react'; import React from 'react';
import renderer from 'react-test-renderer'; import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store'
import MemberView from '../../../../app/ui/components/memberView/MemberView'; import MemberView from '../../../../app/ui/components/memberView/MemberView';
import reducer from '../../../../app/reducers/index';
jest.mock('react-navigation', () => ({ jest.mock('react-navigation', () => ({
withNavigation: component => component, withNavigation: component => component,
})); }));
describe('MemberView component', () => { describe('MemberView component', () => {
const mockStore = configureStore(reducer);
const initialState = { const initialState = {
session: { session: {
token: 'token123', token: 'token123',
}, },
}; };
const store = mockStore(initialState);
const member = { const member = {
pk: 1, pk: 1,
...@@ -25,8 +21,8 @@ describe('MemberView component', () => { ...@@ -25,8 +21,8 @@ describe('MemberView component', () => {
it('renders correctly', () => { it('renders correctly', () => {
const tree = renderer const tree = renderer
.create(<MemberView store={store} member={member} size={20} />) .create(<MemberView store={initialState} member={member} size={20} />)
.toJSON(); .toJSON();
expect(tree).toMatchSnapshot(); expect(tree).toMatchSnapshot();
}); });
}); });
\ No newline at end of file
import React from 'react'; import React from 'react';
import { Platform } from 'react-native';
import renderer from 'react-test-renderer'; import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import StandardHeader from '../../../../app/ui/components/standardHeader/StandardHeader'; import StandardHeader from '../../../../app/ui/components/standardHeader/StandardHeader';
import reducer from '../../../../app/reducers';
import { Platform } from 'react-native';
jest.mock('react-navigation', () => ({ jest.mock('react-navigation', () => ({
withNavigation: component => component, withNavigation: component => component,
...@@ -14,7 +12,6 @@ const mockNavigation = { ...@@ -14,7 +12,6 @@ const mockNavigation = {
}; };
describe('StandardHeader component', () => { describe('StandardHeader component', () => {
const mockStore = configureStore(reducer);
const initialState = { const initialState = {
navigation: { navigation: {
currentScene: 'home', currentScene: 'home',
...@@ -28,12 +25,11 @@ describe('StandardHeader component', () => { ...@@ -28,12 +25,11 @@ describe('StandardHeader component', () => {
token: 'token123', token: 'token123',
}, },
}; };
const store = mockStore(initialState);
it('renders correctly on iOS', () => { it('renders correctly on iOS', () => {
Platform.OS = 'ios'; Platform.OS = 'ios';
const tree = renderer const tree = renderer
.create(<StandardHeader store={store} navigation={mockNavigation} />) .create(<StandardHeader store={initialState} navigation={mockNavigation} />)
.toJSON(); .toJSON();
expect(tree).toMatchSnapshot(); expect(tree).toMatchSnapshot();
}); });
...@@ -41,7 +37,7 @@ describe('StandardHeader component', () => { ...@@ -41,7 +37,7 @@ describe('StandardHeader component', () => {
it('renders correctly on Android', () => { it('renders correctly on Android', () => {
Platform.OS = 'android'; Platform.OS = 'android';
const tree = renderer const tree = renderer
.create(<StandardHeader store={store} navigation={mockNavigation} />) .create(<StandardHeader store={initialState} navigation={mockNavigation} />)
.toJSON(); .toJSON();
expect(tree).toMatchSnapshot(); expect(tree).toMatchSnapshot();
}); });
......
...@@ -3623,6 +3623,14 @@ fs.realpath@^1.0.0: ...@@ -3623,6 +3623,14 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
fsevents@^1.2.3:
version "1.2.7"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4"
integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==
dependencies:
nan "^2.9.2"
node-pre-gyp "^0.10.0"
fsm-iterator@^1.1.0: fsm-iterator@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/fsm-iterator/-/fsm-iterator-1.1.0.tgz#337de45de19eb205788cf02e3a955ec206760dec" resolved "https://registry.yarnpkg.com/fsm-iterator/-/fsm-iterator-1.1.0.tgz#337de45de19eb205788cf02e3a955ec206760dec"
...@@ -6571,7 +6579,7 @@ prompts@^0.1.9: ...@@ -6571,7 +6579,7 @@ prompts@^0.1.9:
kleur "^2.0.1" kleur "^2.0.1"
sisteransi "^0.1.1" sisteransi "^0.1.1"
prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2" version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
...@@ -6852,13 +6860,13 @@ react-native-tab-view@^1.0.0: ...@@ -6852,13 +6860,13 @@ react-native-tab-view@^1.0.0:
dependencies: dependencies:
prop-types "^15.6.1" prop-types "^15.6.1"
react-native-vector-icons@^4.6.0: react-native-vector-icons@^6.3.0:
version "4.6.0" version "6.3.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-4.6.0.tgz#e4014311ffa6de397d914ffc31b7097a874cc8d5" resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-6.3.0.tgz#47a0c9e04e045c0ea0b9ca450e2af84e45c07b3f"
integrity sha512-rpfhfPiXCK2PX1nrNhdxSMrEGB/Gw/SvKoPM0G2wAkSoqynnes19K0VYI+Up7DqR1rFIpE4hP2erpT1tNx2tfg== integrity sha512-3Rf77BC1BhCpHkCitq4hDAEyaAR7Won5qrHU3fBoZzkEsI5oFTCfvnMDYzCx7XDW5Xn0u/Yg7JD9USynAOYVYA==
dependencies: dependencies:
lodash "^4.0.0" lodash "^4.0.0"
prop-types "^15.5.10" prop-types "^15.6.2"
yargs "^8.0.2" yargs "^8.0.2"
react-native@0.58.5: react-native@0.58.5:
...@@ -7127,7 +7135,7 @@ rechoir@^0.6.2: ...@@ -7127,7 +7135,7 @@ rechoir@^0.6.2:
dependencies: dependencies:
resolve "^1.1.6" resolve "^1.1.6"
redux-mock-store@^1.5.1: redux-mock-store@^1.5.3:
version "1.5.3" version "1.5.3"
resolved "https://registry.yarnpkg.com/redux-mock-store/-/redux-mock-store-1.5.3.tgz#1f10528949b7ce8056c2532624f7cafa98576c6d" resolved "https://registry.yarnpkg.com/redux-mock-store/-/redux-mock-store-1.5.3.tgz#1f10528949b7ce8056c2532624f7cafa98576c6d"
integrity sha512-ryhkkb/4D4CUGpAV2ln1GOY/uh51aczjcRz9k2L2bPx/Xja3c5pSGJJPyR25GNVRXtKIExScdAgFdiXp68GmJA== integrity sha512-ryhkkb/4D4CUGpAV2ln1GOY/uh51aczjcRz9k2L2bPx/Xja3c5pSGJJPyR25GNVRXtKIExScdAgFdiXp68GmJA==
......
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