...
 
Commits (9)
......@@ -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]}
......
......@@ -890,7 +890,7 @@ exports[`blog view screen component should renders correctly 1`] = `
underlayColor="white"
/>
</View>
<SafeAreaView
<ForwardRef(_SafeAreaView)
style={
Object {
"left": 0,
......@@ -909,7 +909,7 @@ exports[`blog view screen component should renders correctly 1`] = `
size={22}
underlayColor="white"
/>
</SafeAreaView>
</ForwardRef(_SafeAreaView)>
</View>
}
keyboardVerticalOffset={15}
......@@ -925,8 +925,9 @@ exports[`blog view screen component should renders correctly 1`] = `
store={
CommentsStore {
"attachment": AttachmentStore {
"fileName": null,
"guid": "",
"tempIosVideo": "",
"transcoding": false,
},
"embed": RichEmbedStore {
"_richEmbedFetchTimer": null,
......
import 'react-native';
import React from 'react';
import { Platform, CameraRoll, TouchableOpacity } from "react-native";
import { Platform, TouchableOpacity } from "react-native";
import { shallow, render } from 'enzyme';
import CameraRoll from '@react-native-community/cameraroll';
import androidPermission from '../../src/common/services/android-permissions.service';
import { getPhotosFaker } from '../../__mocks__/fake/CameraRollFaker';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
jest.mock('../../src/common/services/android-permissions.service');
//jest.mock('TouchableOpacity', () => 'TouchableOpacity' )
jest.mock('CameraRoll');
jest.mock('@react-native-community/cameraroll');
CameraRoll.getPhotos = jest.fn();
// fake camera roll data
const response = getPhotosFaker(5);
......
import 'react-native';
import React from 'react';
import { Alert, CameraRoll } from 'react-native';
import { Alert } from 'react-native';
import { shallow } from 'enzyme';
import { Icon } from 'react-native-elements'
import CameraRoll from '@react-native-community/cameraroll';
import CapturePoster from '../../src/capture/CapturePoster';
import CapturePreview from '../../src/capture/CapturePreview';
......@@ -21,7 +22,6 @@ jest.mock('../../src/capture/CapturePosterFlags', () => 'CapturePosterFlags');
jest.mock('../../src/common/services/translation.service');
Alert.alert = jest.fn();
jest.mock('CameraRoll');
CameraRoll.getPhotos = jest.fn();
// fake camera roll data
const response = getPhotosFaker(5);
......
......@@ -27,7 +27,9 @@ exports[`cature tabs component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -94,7 +96,9 @@ exports[`cature tabs component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -161,7 +165,9 @@ exports[`cature tabs component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -17,7 +17,9 @@ exports[`channel actions component should renders correctly 1`] = `
<View
accessibilityLabel="Wire Button"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -91,7 +93,9 @@ exports[`channel actions component should renders correctly 1`] = `
<View
accessibilityLabel="More"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -254,7 +254,7 @@ exports[`Channel screen component should renders correctly 1`] = `
}
hasRewards={0}
/>
<SafeAreaView
<ForwardRef(_SafeAreaView)
style={
Object {
"left": 0,
......@@ -273,7 +273,7 @@ exports[`Channel screen component should renders correctly 1`] = `
size={22}
underlayColor="white"
/>
</SafeAreaView>
</ForwardRef(_SafeAreaView)>
</View>
}
navigation={
......
......@@ -15,7 +15,6 @@ jest.mock('../../../src/auth/UserStore');
jest.mock('../../../AppStores');
jest.mock('../../../src/channel/ChannelStore');
jest.mock('../../../src/common/services/boosted-content.service');
jest.mock('TouchableHighlight', () => 'TouchableHighlight');
/**
* Tests
......
......@@ -4,7 +4,9 @@ exports[`channel header component owner should render correctly 1`] = `
<View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -131,16 +133,26 @@ exports[`channel header component owner should render correctly 1`] = `
</View>
<View>
<View>
<TouchableHighlight
onPress={[Function]}
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
undefined,
]
}
underlayColor="transparent"
>
<View>
<View
style={null}
>
<Text>
SUBSCRIBERS
</Text>
......@@ -148,7 +160,7 @@ exports[`channel header component owner should render correctly 1`] = `
50
</Text>
</View>
</TouchableHighlight>
</View>
<View>
<Text>
VIEWS
......@@ -198,7 +210,9 @@ exports[`channel header component owner should render correctly 1`] = `
<View
accessibilityLabel="Subscribe to this channel"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -252,7 +266,9 @@ exports[`channel header component owner should render correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -32,7 +32,9 @@ exports[`channel subscribers component should render correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -61,7 +63,9 @@ exports[`channel subscribers component should render correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1538,7 +1542,9 @@ exports[`channel subscribers component should render correctly without data 1`]
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1567,7 +1573,9 @@ exports[`channel subscribers component should render correctly without data 1`]
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -4,7 +4,6 @@ import { shallow } from 'enzyme';
import ExplicitOverlay from '../../../src/common/components/explicit/ExplicitOverlay';
import ActivityModel from '../../../src/newsfeed/ActivityModel';
import { activitiesServiceFaker } from '../../../__mocks__/fake/ActivitiesFaker';
jest.mock('TouchableOpacity', () => 'TouchableOpacity');
describe('Explicit overlay component', () => {
......
......@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<View
accessible={true}
focusable={false}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
import {
CameraRoll,
Platform,
} from 'react-native';
import service from '../../../src/common/services/download.service';
import session from '../../../src/common/services/session.service';
import RNFetchBlob from 'react-native-fetch-blob';
import CameraRoll from '@react-native-community/cameraroll';
import permissions from '../../../src/common/services/android-permissions.service';
CameraRoll.saveToCameraRoll = jest.fn();
jest.mock('../../../src/common/services/android-permissions.service');
jest.mock('../../../src/common/services/session.service');
jest.mock('react-native-fetch-blob');
/**
* Tests
*/
......@@ -27,12 +24,12 @@ describe('Download service', () => {
await service.downloadToGallery('url');
expect(CameraRoll.saveToCameraRoll).not.toHaveBeenCalled();
});
it('should call camera roll', async () => {
// call tested method
Platform.OS = 'ios';
await service.downloadToGallery('url');
expect(CameraRoll.saveToCameraRoll).toHaveBeenCalled();
});
});
});
\ No newline at end of file
......@@ -18,6 +18,8 @@ exports[`notification component renders correctly for every type 1`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -108,6 +110,8 @@ exports[`notification component renders correctly for every type 2`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -198,6 +202,8 @@ exports[`notification component renders correctly for every type 3`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -288,6 +294,8 @@ exports[`notification component renders correctly for every type 4`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -402,6 +410,8 @@ exports[`notification component renders correctly for every type 5`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -517,6 +527,8 @@ exports[`notification component renders correctly for every type 6`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -631,6 +643,8 @@ exports[`notification component renders correctly for every type 7`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -721,6 +735,8 @@ exports[`notification component renders correctly for every type 8`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -796,6 +812,8 @@ exports[`notification component renders correctly for every type 9`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -898,6 +916,8 @@ exports[`notification component renders correctly for every type 10`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -988,6 +1008,8 @@ exports[`notification component renders correctly for every type 11`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1019,7 +1041,9 @@ exports[`notification component renders correctly for every type 11`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1092,6 +1116,8 @@ exports[`notification component renders correctly for every type 12`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1165,6 +1191,8 @@ exports[`notification component renders correctly for every type 13`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1196,7 +1224,9 @@ exports[`notification component renders correctly for every type 13`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1269,6 +1299,8 @@ exports[`notification component renders correctly for every type 14`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1355,6 +1387,8 @@ exports[`notification component renders correctly for every type 15`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1436,6 +1470,8 @@ exports[`notification component renders correctly for every type 16`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1467,7 +1503,9 @@ exports[`notification component renders correctly for every type 16`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1542,6 +1580,8 @@ exports[`notification component renders correctly for every type 17`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1617,6 +1657,8 @@ exports[`notification component renders correctly for every type 18`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1692,6 +1734,8 @@ exports[`notification component renders correctly for every type 19`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1723,7 +1767,9 @@ exports[`notification component renders correctly for every type 19`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1796,6 +1842,8 @@ exports[`notification component renders correctly for every type 20`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1880,6 +1928,8 @@ exports[`notification component renders correctly for every type 21`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1961,6 +2011,8 @@ exports[`notification component renders correctly for every type 22`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1992,7 +2044,9 @@ exports[`notification component renders correctly for every type 22`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2045,6 +2099,8 @@ exports[`notification component renders correctly for every type 23`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2118,6 +2174,8 @@ exports[`notification component renders correctly for every type 24`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2191,6 +2249,8 @@ exports[`notification component renders correctly for every type 25`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2266,6 +2326,8 @@ exports[`notification component renders correctly for every type 26`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2350,6 +2412,8 @@ exports[`notification component renders correctly for every type 27`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2431,6 +2495,8 @@ exports[`notification component renders correctly for every type 28`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly for activity 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -49,7 +51,9 @@ exports[`renders correctly for activity 1`] = `
exports[`renders correctly for comment 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -97,7 +101,9 @@ exports[`renders correctly for comment 1`] = `
exports[`renders correctly for object 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly for activity 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -49,7 +51,9 @@ exports[`renders correctly for activity 1`] = `
exports[`renders correctly for comment 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -97,7 +101,9 @@ exports[`renders correctly for comment 1`] = `
exports[`renders correctly for object 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly activity 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -29,7 +31,9 @@ exports[`renders correctly activity 1`] = `
exports[`renders correctly comment 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -166,7 +166,9 @@ exports[`WithdrawScreen renders correctly 1`] = `
/>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -71,7 +71,7 @@
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/mp4" />
<data android:mimeType="video/*" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
......
......@@ -31,6 +31,8 @@ platform :android do
build_type: "Release",
print_command: false,
properties: {
"android.enableJetifier" => "true",
"android.useAndroidX" => "true",
"android.injected.signing.store.file" => "minds.keystore",
"android.injected.signing.store.password" => ENV['KEYSTORE_PASSWORD'],
"android.injected.signing.key.alias" => "alias_name",
......
......@@ -14,7 +14,7 @@ const config = {
],
"moduleNameMapper": {
"^image![a-zA-Z0-9$_-]+$": "GlobalImageStub",
"^[@./a-zA-Z0-9$_-]+\\.(png|gif)$": "RelativeImageStub"
// "^[@./a-zA-Z0-9$_-]+\\.(png|gif)$": "RelativeImageStub"
},
"snapshotSerializers": [
"./node_modules/enzyme-to-json/serializer"
......
......@@ -13,7 +13,8 @@
"locale": "ts-node tasks/poeditor.js",
"e2e": "jest -c jest.e2e.config.js",
"e2e-local": "e2elocal=1 jest -c jest.e2e.config.js",
"preinstall": "git config core.hooksPath .githooks"
"preinstall": "git config core.hooksPath .githooks",
"postinstall": "jetify"
},
"dependencies": {
"@hawkingnetwork/node-libs-react-native": "^1.0.10",
......@@ -34,7 +35,7 @@
"moment-timezone": "^0.5.27",
"promise-cancelable": "^2.1.1",
"react": "16.9.0",
"react-native": "0.61.2",
"react-native": "0.61.4",
"react-native-actionsheet": "^2.4.2",
"react-native-animatable": "^1.3.3",
"react-native-collapsible-header-views": "^1.0.2",
......@@ -45,7 +46,7 @@
"react-native-exception-handler": "^2.10.8",
"react-native-exit-app": "wumke/react-native-exit-app",
"react-native-fast-image": "^7.0.2",
"react-native-file-share-intent": "^1.1.2",
"react-native-file-share-intent": "Minds/react-native-file-share-intent",
"react-native-file-type": "^0.0.8",
"react-native-flash-message": "^0.1.15",
"react-native-fs": "^2.16.1",
......@@ -58,7 +59,7 @@
"react-native-minds-encryption": "Minds/react-native-minds-encryption#736571522c9d5f96c9bc4b454b2828e3940b6ccc",
"react-native-modal": "^11.4.0",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-notifications": "Minds/react-native-notifications.git",
"react-native-notifications": "Minds/react-native-notifications#333e376f866a805f250cc68706d97ace503b948a",
"react-native-phone-input": "thegamenicorus/react-native-phone-input#6ab1a91a09ddd4272fe85e30ecedf092f0fcb1a7",
"react-native-progress": "^3.6.0",
"react-native-qrcode-svg": "^5.2.0",
......
......@@ -3,5 +3,6 @@ export default {
get: jest.fn(),
put: jest.fn(),
upload: jest.fn(),
delete: jest.fn()
}
\ No newline at end of file
delete: jest.fn(),
clearCookies: jest.fn(),
};
const feedService = function() {
this.getEntities = jest.fn();
this.prepend = jest.fn();
this.setPaginated =jest.fn().mockImplementation(() => this);
this.setInjectBoost = jest.fn().mockImplementation(() => this);
this.setLimit = jest.fn().mockImplementation(() => this);
this.setOffset = jest.fn().mockImplementation(() => this);
......
......@@ -162,7 +162,11 @@ class ImagePickerService {
takePhotoButtonTitle: i18n.t('imagePicker.camera'),
chooseFromLibraryButtonTitle: i18n.t('imagePicker.gallery'),
cancelButtonTitle: i18n.t('imagePicker.cancel'),
noData: true // improve performance! (no base64 conversion field)
noData: true, // improve performance! (no base64 conversion field)
storageOptions: {
cameraRoll: true,
waitUntilSaved: true,
},
}
}
}
......
import RNFileShareIntent from 'react-native-file-share-intent';
import navigationService from '../../navigation/NavigationService';
import { Platform } from 'react-native';
const IMAGE_PREFIX = /^image\/([a-z]|\*)*@/;
const VIDEO_PREFIX = /^video\/([a-z]|\*)*@/;
/**
* Receive Share Service
......@@ -13,16 +10,15 @@ class ReceiveShareService {
* Handle received data
*/
handle() {
// TODO: 0.61 fix the handling of content:// file paths
// TODO: 0.61 Implement Shared.js for ios
RNFileShareIntent.getFilepath(text => {
if (text && text !== null) {
if (text.match(IMAGE_PREFIX)) {
navigationService.navigate('Capture',{image: text.replace(IMAGE_PREFIX, '')});
} else if (text.match(VIDEO_PREFIX)) {
navigationService.navigate('Capture',{video: text.replace(VIDEO_PREFIX, '')});
RNFileShareIntent.getFilepath(async (text, type) => {
RNFileShareIntent.clearFilePath();
if (text && type) {
if (type.startsWith('video/')) {
navigationService.navigate('Capture', {video: text});
} else if (type.startsWith('image/')) {
navigationService.navigate('Capture', {image: text});
} else {
navigationService.navigate('Capture',{text});
navigationService.navigate('Capture', {text});
}
}
});
......
......@@ -7440,10 +7440,9 @@ react-native-fast-image@^7.0.2:
resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-7.0.2.tgz#e06b21f42f4a9786eaa86f3db35d919070fb8403"
integrity sha512-MfuzJbC0RjYobR2gFCdqe1I7jvNOCfDkjQ7VGOHXniqjohhULMkcWNBE9Umovi9Dx93lJ6t5utcE2wf/09zvlg==
react-native-file-share-intent@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/react-native-file-share-intent/-/react-native-file-share-intent-1.1.2.tgz#7c99fe526b7c0e894ed7fe2a567a220a80d116e9"
integrity sha512-70I2c3HXVxG8XOM+Pd4Nq4BITwFqWJFbPIJSLEtjt7SHv81ATWkf/pn3PxukLrJBrEAx6LrfUjGyDouvxujz4A==
react-native-file-share-intent@Minds/react-native-file-share-intent:
version "1.1.1"
resolved "https://codeload.github.com/Minds/react-native-file-share-intent/tar.gz/d46d7a9f04352d201b1f7d502706b31c3322722c"
react-native-file-type@^0.0.8:
version "0.0.8"
......@@ -7552,7 +7551,7 @@ react-native-modal@^11.0.2, react-native-modal@^11.4.0:
prop-types "^15.6.2"
react-native-animatable "^1.3.1"
react-native-notifications@Minds/react-native-notifications.git:
react-native-notifications@Minds/react-native-notifications#333e376f866a805f250cc68706d97ace503b948a:
version "2.0.6"
resolved "https://codeload.github.com/Minds/react-native-notifications/tar.gz/333e376f866a805f250cc68706d97ace503b948a"
dependencies:
......@@ -7687,10 +7686,10 @@ react-native-webview@^7.4.2:
escape-string-regexp "2.0.0"
invariant "2.2.4"
react-native@0.61.2:
version "0.61.2"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.61.2.tgz#987b91b063557f8ebec803fdfea2044a24bdbe4d"
integrity sha512-hhd8bYbkkZYHoOndxUwbjJ6Yd9HFn5PvwqqS41uJ1xADdw44rx/svuwmJNA1RKF7jH74uR2jpBViWYGd36zGyg==
react-native@0.61.4:
version "0.61.4"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.61.4.tgz#9ec6e8a2aa8eac57143dcfa39115c7d9a139bc2c"
integrity sha512-L8U+dDEy4vP74yWYbb+2XKaZeUkbpCUoSzcmeEM8Oznt69q71Q4fuYyxZGrzVW6tMYw9ZzGXTkfLuOh2nvLeVw==
dependencies:
"@babel/runtime" "^7.0.0"
"@react-native-community/cli" "^3.0.0-alpha.1"
......