Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
4.29.0 RC1

See merge request minds/mobile-native!1900
  • Loading branch information
msantang78 committed Oct 2, 2022
2 parents 70f0028 + 8da397e commit ca3999d
Show file tree
Hide file tree
Showing 161 changed files with 9,356 additions and 2,784 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ release:codepush-ios:
stage: release
tags: [minds-ci]
before_script:
- npm install -g patch-package
- npm install -g appcenter-cli
- yarn install
script:
Expand All @@ -481,6 +482,7 @@ release:codepush-android:
stage: release
tags: [minds-ci]
before_script:
- npm install -g patch-package
- npm install -g appcenter-cli
- yarn install
script:
Expand Down
83 changes: 35 additions & 48 deletions __mocks__/fake/ActivitiesFaker.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,59 @@

function load(count, container) {

let activities = [...Array(count)].map((_, i) => {
const code = 'activityguid' + i;
return {
attachment_guid: false,
blurb: false,
container_guid:code,
custom_data:false,
custom_type:false,
container_guid: code,
custom_data: false,
custom_type: false,
rowKey: 'something' + i,
description:"Congratulations! ",
edited:"",
guid:code,
mature:false,
time_created: "1522036284",
ownerObj:{
guid: "824853017709780997",
type: "user",
description: 'Congratulations! ',
edited: '',
guid: code,
mature: false,
time_created: '1522036284',
ownerObj: {
guid: '824853017709780997',
type: 'user',
subtype: false,
time_created: "1522036284",
// getAvatarSource: () => {
// return {
// source:'http://thisisaurl'
// }
// }
time_created: '1522036284',
},
shouldBeBlured: jest.fn(),
message:"Message",
title:'TITLE',
owner_guid:"824853017709780997",
parent_guid:"838106762591510528",
perma_url:false,
thumbnail_src:false,
type:"activity",
message: 'Message',
title: 'TITLE',
owner_guid: '824853017709780997',
parent_guid: '838106762591510528',
perma_url: false,
thumbnail_src: false,
type: 'activity',
wire_totals: {
tokens: 1000000000000000000
tokens: 1000000000000000000,
},
containerObj: container
// _list: {
// viewed: {
// viewed: new Map([["1019155171608096768",true]]),
// addViewed: () => {
// return;
// }
// }
// },
// getThumbSource: () => {
// return {
// source:'http://thisisaurl'
// }
// }
}
containerObj: container,
};
});

return {
'activities': activities,
activities: activities,
'load-next': 'aaaaaa',
'load-previous': 'aaaaaa'
}

'load-previous': 'aaaaaa',
};
}

/**
* comment service data faker
* @param {integer} count
*/
export function activitiesServiceFaker() {
return { load: load}
return { load: load };
}

/**
* Generate a single fake entity
* @param {object} containerObj optional entity container
* @returns
*/
export function fakeOne(containerObj) {
const resp = load(1, containerObj);
return resp.activities[0];
}
19 changes: 19 additions & 0 deletions __mocks__/fake/supermind/SupermindRequestFaker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { fakeOne } from '../ActivitiesFaker';

export default function supermindRequestFaker() {
return {
guid: '1',
activity_guid: '1',
sender_guid: '1',
receiver_guid: '1',
status: 1,
payment_amount: 1,
payment_method: 1,
payment_txid: '',
created_timestamp: 1662991439,
expiry_threshold: 7 * 86400,
twitter_required: false,
reply_type: 1,
entity: fakeOne(),
};
}
5 changes: 5 additions & 0 deletions __mocks__/react-native-awesome-gallery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { View } from 'react-native';

const Gallery = View;

export default Gallery;
6 changes: 2 additions & 4 deletions __tests__/activity/components/Activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import BottomContent from '../../../src/newsfeed/activity/BottomContent';
import MediaView from '../../../src/common/components/MediaView';

import ActivityModel from '../../../src/newsfeed/ActivityModel';
import MindsVideoV2 from '../../../src/media/v2/mindsVideo/MindsVideo';

jest.mock('../../../src/common/services/session.service');

jest.mock('../../../src/media/v2/mindsVideo/MindsVideo', () => 'MindsVideoV2');
jest.mock(
Expand Down Expand Up @@ -46,13 +47,10 @@ describe('Activity component', () => {
});

it('renders correctly', async () => {
screen.update();
expect(screen).toMatchSnapshot();
});

it('should have a Media View', async () => {
screen.update();

expect(screen.find(MediaView)).toHaveLength(1);
});

Expand Down
84 changes: 7 additions & 77 deletions __tests__/activity/components/__snapshots__/Activity.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -96,17 +97,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down Expand Up @@ -145,6 +135,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -201,17 +192,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down Expand Up @@ -256,6 +236,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -312,17 +293,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down Expand Up @@ -385,6 +355,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -441,17 +412,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down Expand Up @@ -508,6 +468,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -564,17 +525,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down Expand Up @@ -638,6 +588,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -694,17 +645,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down Expand Up @@ -752,6 +692,7 @@ exports[`Activity component renders correctly 1`] = `
"impressions": 0,
"isOwner": [Function],
"is_visible": false,
"listenForMetricsDebounced": [Function],
"mature": false,
"mature_visibility": false,
"message": "Message",
Expand Down Expand Up @@ -808,17 +749,6 @@ exports[`Activity component renders correctly 1`] = `
"quotes": 0,
"reminds": 0,
"rowKey": "something0",
"shouldBeBlured": [MockFunction] {
"calls": Array [
Array [],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"subtype": "",
"thumbnail_src": false,
"thumbs:down:count": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`activity metrics component renders correctly 1`] = `
"padding": 8,
},
Object {
"paddingLeft": 16,
"paddingHorizontal": 16,
},
]
}
Expand Down
Loading

0 comments on commit ca3999d

Please sign in to comment.