Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • benhayward.ben/mobile-native
  • minds/mobile-native
  • msantang78/mobile-native
  • edgebal/mobile-native
  • msantang78_test/mobile-native
  • duyquoc/mobile-native
  • priestd09/mobile-native
  • eiennohi/mobile-native
  • omadrid/mobile-native
  • sieuhuflit/mobile-native
  • juanmsolaro/mobile-native
  • ascenderking/mobile-native
  • jim-toth/mobile-native
  • thinnakrit/mobile-native-lang
  • project_connection/mobile-native
  • AaronTheBruce/mobile-native
  • cormac.kantargis.hack/mobile-native
  • xthread/mobile-native
  • Paulnguyenun/mobile-native
  • lustigdev/mobile-native
  • GubbenOlsson/mobile-native
  • calvinoea/mobile-native
  • namesty/mobile-native
  • mrrobot16/mobile-native
  • eliobricenov/mobile-native
  • bedriguler/mobile-native
  • m994/mobile-native
  • threetoes/mobile-native
  • liangel/mobile-native
  • hosituan/mobile-native
  • nacef.otay/mobile-native
  • madibaa/mobile-native
  • valentin129/mobile-native
  • manishoo/mobile-native1
34 results
Show changes
Commits on Source (9)
Showing
with 330 additions and 124 deletions
......@@ -6,7 +6,7 @@ stages:
- deploy
test:jest:
image: node:10.10.0
image: node:10.16.3
stage: test
cache:
key: ${CI_COMMIT_REF_SLUG}
......@@ -22,7 +22,7 @@ build:android:
stage: build
before_script:
- sudo sysctl fs.inotify.max_user_watches=524288
- sudo sysctl -p
- sudo sysctl -p
script:
- yarn install
- cd android
......@@ -37,7 +37,7 @@ build:android:
when: on_success
e2e:browserstacks:
image: node:10.10.0
image: node:10.16.3
stage: e2e
cache:
key: ${CI_COMMIT_REF_SLUG}
......
//import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'
import './global';
import './shim'
//import crypto from "crypto"; // DO NOT REMOVE!
import React, {
Component
} from 'react';
import {
createStackNavigator,
NavigationActions
} from 'react-navigation';
import {
BackHandler,
Platform,
AppState,
Linking,
Text,
Alert,
View,
} from 'react-native';
import NavigationStack from './src/navigation/NavigationStack';
import NavigationService from './src/navigation/NavigationService';
const Stack = createStackNavigator({});
/**
* App
*/
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
appState: AppState.currentState
};
}
/**
* Handle app state changes
*/
handleAppStateChange = (nextState) => {
// if the app turns active we check for shared
if (this.state.appState.match(/inactive|background/) && nextState === 'active') {
receiveShare.handle();
}
this.setState({appState: nextState})
}
/**
* On component will mount
*/
componentWillMount() {
if (!Text.defaultProps) Text.defaultProps = {};
Text.defaultProps.style = {
fontFamily: 'Roboto',
color: '#444',
};
}
/**
* Render
*/
render() {
const app = (
<View></View>
);
return [ app ];
}
}
......@@ -295,8 +295,7 @@ export default class App extends Component<Props, State> {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
<FlashMessage renderCustomContent={this.renderNotification}
/>
<FlashMessage renderCustomContent={this.renderNotification} />
</ErrorBoundary>
</Provider>
);
......@@ -310,7 +309,7 @@ export default class App extends Component<Props, State> {
);
const tosModal = (
<TosModal user={stores.user}/>
<TosModal user={stores.user} key="tosModal"/>
)
return [ app, keychainModal, blockchainTransactionModal, tosModal];
......
export default {
}
\ No newline at end of file
import { View as mockView } from "react-native";
export default {
Value: jest.fn(),
event: jest.fn(),
add: jest.fn(),
eq: jest.fn(),
set: jest.fn(),
cond: jest.fn(),
interpolate: jest.fn(),
View: mockView,
Extrapolate: { CLAMP: jest.fn() },
Clock: jest.fn(),
greaterThan: jest.fn(),
lessThan: jest.fn(),
startClock: jest.fn(),
stopClock: jest.fn(),
clockRunning: jest.fn(),
not: jest.fn(),
or: jest.fn(),
and: jest.fn(),
spring: jest.fn(),
decay: jest.fn(),
defined: jest.fn(),
call: jest.fn(),
Code: mockView,
block: jest.fn(),
abs: jest.fn(),
greaterOrEq: jest.fn(),
lessOrEq: jest.fn(),
debug: jest.fn(),
Transition: {
Out: "Out"
},
};
export default {
Header: {}
};
export const createStackNavigator = jest.fn();
export const Header = {
HEIGHT:80,
};
export const createMaterialTopTabNavigator = jest.fn().mockImplementation(x => ({router: 'router'}));
export default {
createDrawerNavigator: jest.fn(),
withNavigation: jest.fn(),
StackActions: {
push: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/PUSH"})),
replace: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/REPLACE"})),
},
};
export const createAppContainer = jest.fn().mockReturnValue(function NavigationContainer(props) {return null;});
export const createSwitchNavigator = jest.fn().mockImplementation(x => ({router: 'router'}));
export const withNavigation = jest.fn();
export const Header = {
HEIGHT:80
}
export const StackActions = {
reset: jest.fn()
}
......
import 'react-native';
import React from 'react';
import App from '../App';
import videochat from '../src/common/services/videochat.service';
import sqliteStorageProviderService from '../src/common/services/sqlite-storage-provider.service';
import logService from '../src/common/services/log.service';
import {
......@@ -18,31 +17,16 @@ jest.mock('../src/common/services/sqlite-storage-provider.service')
jest.mock('../src/common/services/log.service', () => {});
jest.mock('../src/common/services/push.service');
jest.mock('react-native-gesture-handler', () => {});
jest.mock('react-navigation-stack', () => { Header: {} });
jest.mock('react-navigation', () => {
return {
createAppContainer: jest.fn().mockReturnValue(function NavigationContainer(props) {return null;}),
createDrawerNavigator: jest.fn(),
createMaterialTopTabNavigator: jest.fn().mockImplementation(x => ({router: 'router'})),
createStackNavigator: jest.fn(),
withNavigation: jest.fn(),
StackActions: {
push: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/PUSH"})),
replace: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/REPLACE"})),
},
NavigationActions: {
navigate: jest.fn().mockImplementation(x => x),
}
}
});
// use the web3 mock to prevent sintax error from node_tar
jest.mock('web3');
//mock notifications
jest.mock('react-native-notifications');
jest.mock('../src/common/services/videochat.service');
jest.mock('react-native-convert-ph-asset');
jest.mock('react-navigation');
jest.mock('react-navigation-tabs');
jest.mock('react-navigation-stack');
//mock i18n
jest.mock('react-native-video');
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Activity component renders correctly 1`] = `
<ContextConsumer>
<Component />
</ContextConsumer>
<View
style={
Object {
"flex": 1,
}
}
>
<View
style={
Object {
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"padding": 4,
"paddingBottom": 8,
"paddingTop": 8,
}
}
>
<ThumbUpAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
me={
Object {
"guid": "guidguid",
}
}
/>
<ThumbDownAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
me={
Object {
"guid": "guidguid",
}
}
/>
<WireAction
owner={
Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
}
}
/>
<CommentsAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
/>
<RemindAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
/>
</View>
</View>
`;
......@@ -16,7 +16,9 @@ exports[`Boost action component renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -2,19 +2,15 @@ import api from '../../src/common/services/api.service';
import session from '../../src/common/services/session.service';
import authService from '../../src/auth/AuthService';
import delay from '../../src/common/helpers/delay';
import CookieManager from 'react-native-cookies';
jest.mock('../../src/common/services/api.service');
jest.mock('../../src/common/services/session.service');
jest.mock('../../src/common/helpers/delay', () => jest.fn());
jest.mock('react-native-cookies');
describe('auth service login', () => {
beforeEach(() => {
api.post.mockClear();
session.login.mockClear();
CookieManager.clearAll.mockClear();
CookieManager.clearAll.mockResolvedValue();
delay.mockClear();
delay.mockResolvedValue();
});
......
import 'react-native';
import React from 'react';
import { Text, TouchableOpacity } from "react-native";
import { shallow } from 'enzyme';
import RegisterScreen from '../../src/auth/RegisterScreen';
import { NavigationActions, StackActions } from 'react-navigation';
jest.mock('../../src/auth/RegisterForm', () => 'RegisterForm');
jest.mock('../../src/common/components/VideoBackground', () => 'VideoBackground');
......@@ -35,15 +33,14 @@ describe('RegisterScreen component', () => {
it('should navigate on RegisterForm events', async () => {
const navigation = {
dispatch: jest.fn()
dispatch: jest.fn(),
navigate: jest.fn(),
};
const wrapper = shallow(
<RegisterScreen navigation={navigation}/>
);
StackActions.reset.mockReturnValue(1)
// find register form
const registerForms = wrapper.find('RegisterForm');
......@@ -53,10 +50,7 @@ describe('RegisterScreen component', () => {
// simulate onBack event
registerForms.at(0).props().onBack();
// should call navigate
expect(StackActions.reset).toBeCalledWith({"actions": [undefined], "index": 0});
// with a navigation action with route to Login
expect(NavigationActions.navigate).toBeCalledWith({"routeName": "Login"});
expect(navigation.navigate).toBeCalledWith('Login');
});
});
......@@ -87,7 +87,9 @@ exports[`ForgotPassword component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -193,7 +195,9 @@ exports[`ForgotPassword component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -42,7 +42,11 @@ exports[`ForgotScreen component should renders correctly 1`] = `
>
<Image
resizeMode="contain"
source={1}
source={
Object {
"testUri": "../../../src/assets/logos/logo-white.png",
}
}
style={
Object {
"alignSelf": "center",
......@@ -151,7 +155,9 @@ exports[`ForgotScreen component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -257,7 +263,9 @@ exports[`ForgotScreen component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -133,7 +133,9 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -239,7 +241,9 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -413,6 +417,7 @@ exports[`LoginForm component should renders correctly 1`] = `
onModalWillHide={[Function]}
onModalWillShow={[Function]}
onRequestClose={[Function]}
scrollHorizontal={false}
scrollOffset={0}
scrollOffsetMax={0}
scrollTo={null}
......@@ -428,6 +433,8 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -454,6 +461,7 @@ exports[`LoginForm component should renders correctly 1`] = `
onModalWillHide={[Function]}
onModalWillShow={[Function]}
pointerEvents="box-none"
scrollHorizontal={false}
scrollOffset={0}
scrollOffsetMax={0}
scrollTo={null}
......@@ -622,7 +630,9 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -659,7 +669,9 @@ exports[`LoginForm component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -42,7 +42,11 @@ exports[`LoginScreen component should renders correctly 1`] = `
>
<Image
resizeMode="contain"
source={1}
source={
Object {
"testUri": "../../../src/assets/logos/logo-white.png",
}
}
style={
Object {
"alignSelf": "center",
......
......@@ -105,7 +105,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
/>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -181,7 +183,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -296,7 +300,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -402,7 +408,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`blog card component should renders correctly 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -546,7 +546,9 @@ exports[`blog list screen component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -583,7 +585,9 @@ exports[`blog list screen component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......