Skip to content
Commits on Source (15)
...@@ -3,7 +3,7 @@ import sleep from '../../src/common/helpers/sleep'; ...@@ -3,7 +3,7 @@ import sleep from '../../src/common/helpers/sleep';
export default async(driver) => { export default async(driver) => {
// select first image // select first image
const firstImage = await driver.waitForElementByAccessibilityId('Gallery Image 0', wd.asserters.isDisplayed, 5000); const firstImage = await driver.waitForElementByAccessibilityId('Gallery image/jpeg', wd.asserters.isDisplayed, 5000);
await firstImage.click(); await firstImage.click();
await sleep(3000); await sleep(3000);
......
...@@ -42,7 +42,7 @@ describe('Discovery post edit flow', () => { ...@@ -42,7 +42,7 @@ describe('Discovery post edit flow', () => {
it('should search for the post', async () => { it('should search for the post', async () => {
// select all list // select all list
const all = await driver.waitForElementByAccessibilityId('Discovery All', wd.asserters.isDisplayed, 1000); const all = await driver.waitForElementByAccessibilityId('Discovery All', wd.asserters.isDisplayed, 5000);
await all.click(); await all.click();
await sleep(500); await sleep(500);
......
...@@ -66,7 +66,7 @@ describe('Post flow tests', () => { ...@@ -66,7 +66,7 @@ describe('Post flow tests', () => {
await driver.waitForElementByAccessibilityId('Newsfeed Screen', wd.asserters.isDisplayed, 10000); await driver.waitForElementByAccessibilityId('Newsfeed Screen', wd.asserters.isDisplayed, 10000);
// the first element of the list should be the post // the first element of the list should be the post
const textElement = await driver.waitForElementByXPath('//android.view.ViewGroup[@content-desc="Newsfeed Screen"]/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[1]'); const textElement = await driver.waitForElementByXPath('//android.view.ViewGroup[@content-desc="Newsfeed Screen"]/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[2]');
expect(await textElement.text()).toBe(str); expect(await textElement.text()).toBe(str);
}); });
...@@ -138,7 +138,7 @@ describe('Post flow tests', () => { ...@@ -138,7 +138,7 @@ describe('Post flow tests', () => {
// get the Image touchable // get the Image touchable
const imageButton = await driver.waitForElementByAccessibilityId('Posted Image', wd.asserters.isDisplayed, 10000); const imageButton = await driver.waitForElementByAccessibilityId('Posted Image', wd.asserters.isDisplayed, 10000);
await imageButton.click(); await imageButton.click();
const image = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ImageView'); const image = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ImageView');
const goBack = await driver.waitForElementByAccessibilityId('Go back button', wd.asserters.isDisplayed, 10000); const goBack = await driver.waitForElementByAccessibilityId('Go back button', wd.asserters.isDisplayed, 10000);
await goBack.click(); await goBack.click();
......
...@@ -27,9 +27,10 @@ describe('Top-bar tests', () => { ...@@ -27,9 +27,10 @@ describe('Top-bar tests', () => {
}); });
it('should open the boost console', async () => { it('should open the boost console', async () => {
const button = await driver.waitForElementByAccessibilityId('boost-console button', wd.asserters.isDisplayed, 5000); const button = await driver.waitForElementByAccessibilityId('boost-console button', wd.asserters.isDisplayed, 7000);
await button.click(); await button.click();
const textElement = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView'); const textElement = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView');
expect(await textElement.text()).toBe('Boost Console'); expect(await textElement.text()).toBe('Boost Console');
const back = await driver.waitForElementByXPath('//android.widget.Button[@content-desc="Go back"]/android.view.ViewGroup/android.widget.ImageView'); const back = await driver.waitForElementByXPath('//android.widget.Button[@content-desc="Go back"]/android.view.ViewGroup/android.widget.ImageView');
...@@ -39,10 +40,9 @@ describe('Top-bar tests', () => { ...@@ -39,10 +40,9 @@ describe('Top-bar tests', () => {
it('should open the users profile on clicking the profile avatar', async () => { it('should open the users profile on clicking the profile avatar', async () => {
const button = await driver.waitForElementByAccessibilityId('topbar avatar button', wd.asserters.isDisplayed, 5000); const button = await driver.waitForElementByAccessibilityId('topbar avatar button', wd.asserters.isDisplayed, 5000);
await button.click(); await button.click();
await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.widget.ImageView'); await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[3]/android.widget.ImageView');
const back = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView') const back = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView'); back.click();
back.click();
}); });
it('should open the menu when clicking the hamburger menu', async () => { it('should open the menu when clicking the hamburger menu', async () => {
......
...@@ -39,7 +39,7 @@ exports[`blog card component should renders correctly 1`] = ` ...@@ -39,7 +39,7 @@ exports[`blog card component should renders correctly 1`] = `
source={ source={
Object { Object {
"headers": Object { "headers": Object {
"App-Version": "3.8.0-rc1", "App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate", "Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache", "Pragma": "no-cache",
}, },
......
...@@ -165,7 +165,7 @@ exports[`blog view screen component should renders correctly 1`] = ` ...@@ -165,7 +165,7 @@ exports[`blog view screen component should renders correctly 1`] = `
source={ source={
Object { Object {
"headers": Object { "headers": Object {
"App-Version": "3.8.0-rc1", "App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate", "Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache", "Pragma": "no-cache",
}, },
......
...@@ -32,7 +32,7 @@ exports[`channel header component owner should render correctly 1`] = ` ...@@ -32,7 +32,7 @@ exports[`channel header component owner should render correctly 1`] = `
source={ source={
Object { Object {
"headers": Object { "headers": Object {
"App-Version": "3.8.0-rc1", "App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate", "Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache", "Pragma": "no-cache",
}, },
......
...@@ -47,6 +47,10 @@ export default class Boost extends Component { ...@@ -47,6 +47,10 @@ export default class Boost extends Component {
renderEntity() { renderEntity() {
const entity = this.props.boost.entity; const entity = this.props.boost.entity;
if (!entity) {
return null;
}
switch (entity.type) { switch (entity.type) {
case 'activity': case 'activity':
return <Activity entity={ActivityModel.create(entity)} hideTabs={true} navigation={this.props.navigation} />; return <Activity entity={ActivityModel.create(entity)} hideTabs={true} navigation={this.props.navigation} />;
......
...@@ -132,7 +132,7 @@ export default class CaptureGallery extends PureComponent { ...@@ -132,7 +132,7 @@ export default class CaptureGallery extends PureComponent {
}) })
} }
} }
{...testID(`Gallery Image ${index}`)} {...testID(`Gallery ${node.type}`)}
> >
<Image <Image
source={{ uri : node.image.uri }} source={{ uri : node.image.uri }}
......
...@@ -413,8 +413,6 @@ export default class CapturePoster extends Component { ...@@ -413,8 +413,6 @@ export default class CapturePoster extends Component {
onNsfw = values => { onNsfw = values => {
const nsfw = [...values]; const nsfw = [...values];
this.setState({ nsfw }); this.setState({ nsfw });
creatorNsfwService.set(nsfw);
} }
onShare = network => { onShare = network => {
......
...@@ -30,12 +30,12 @@ class AttachmentService { ...@@ -30,12 +30,12 @@ class AttachmentService {
let promise; let promise;
if(file.type.includes('video')){ if (file.type.includes('video')) {
promise = this.uploadToS3(file,progress); promise = this.uploadToS3(file, progress);
} else { } else {
promise = api.upload('api/v1/media/', file, extra, progress); promise = api.upload('api/v1/media/', file, extra, progress);
} }
return promise; return promise;
} }
...@@ -44,31 +44,29 @@ class AttachmentService { ...@@ -44,31 +44,29 @@ class AttachmentService {
* 1) prepare request return lease with signed url * 1) prepare request return lease with signed url
* 2) upload file to S3 with signed url * 2) upload file to S3 with signed url
* 3) complete upload * 3) complete upload
* @param {any} file * @param {any} file
* @param {function} progress * @param {function} progress
*/ */
uploadToS3(file, progress){ uploadToS3(file, progress){
// Prepare media and wait for lease => {media_type, guid} // Prepare media and wait for lease => {media_type, guid}
let lease; let lease;
return new Cancelable((resolve, reject, onCancel) => { return new Cancelable(async (resolve, reject, onCancel) => {
api.put(`api/v2/media/upload/prepare/video`).then((response) => { const response = await api.put(`api/v2/media/upload/prepare/video`);
lease = response.lease
// upload file to s3 // upload file to s3
const uploadPromise = api.uploadToS3(lease, file, progress).then(async () => { const uploadPromise = api.uploadToS3(response.lease, file, progress).then(async () => {
// complete upload and wait for status // complete upload and wait for status
const {status} = await api.put(`api/v2/media/upload/complete/${lease.media_type}/${lease.guid}`); const {status} = await api.put(`api/v2/media/upload/complete/${response.lease.media_type}/${response.lease.guid}`);
// if false is returned, upload fails message will be showed // if false is returned, upload fails message will be showed
return status === 'success' ? {guid: lease.guid} : false; return status === 'success' ? {guid: response.lease.guid} : false;
}); });
// handle cancel // handle cancel
onCancel((cb) => { onCancel((cb) => {
uploadPromise.cancel(); uploadPromise.cancel();
cb(); cb();
}); });
return uploadPromise; resolve(uploadPromise);
});
}).catch( error => { }).catch( error => {
if (error.name !== 'CancelationError') { if (error.name !== 'CancelationError') {
logService.exception('[ApiService] upload', error); logService.exception('[ApiService] upload', error);
......
export const Version = { export const Version = {
VERSION: '3.8.0-rc1', VERSION: '3.8.0',
BUILD: '20190723' BUILD: '20190806'
}; };
...@@ -236,8 +236,8 @@ export default class ActivityModel extends BaseModel { ...@@ -236,8 +236,8 @@ export default class ActivityModel extends BaseModel {
@action @action
async updateActivity(data = {}) { async updateActivity(data = {}) {
const list = this._list; const list = this.__list;
delete(this._list); delete(this.__list);
const entity = toJS(this); const entity = toJS(this);
this._list = list; this._list = list;
......