Merge branch 'develop' into update-minors-patches

This commit is contained in:
Diego Mello 2021-06-11 15:25:09 -03:00 committed by GitHub
commit ee4d42ee95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 449 additions and 38 deletions

View File

@ -59100,6 +59100,404 @@ exports[`Storyshots Room Item Tag 1`] = `
</RCTScrollView> </RCTScrollView>
`; `;
exports[`Storyshots Room Item Touch 1`] = `
<RCTScrollView
style={
Object {
"backgroundColor": "#ffffff",
}
}
>
<View>
<View>
<View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"height": 150,
"left": 0,
"position": "absolute",
"right": 0,
},
undefined,
]
}
>
<View
style={
Object {
"backgroundColor": "#1d74f5",
"height": 150,
"justifyContent": "center",
"position": "absolute",
"right": 670,
"top": 0,
"transform": Array [
Object {
"translateX": -80,
},
],
"width": 750,
}
}
>
<View
style={
Object {
"height": 150,
"justifyContent": "center",
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "white",
"fontSize": 20,
},
undefined,
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 15,
"fontWeight": "600",
"justifyContent": "center",
"marginTop": 4,
"textAlign": "left",
},
Object {
"color": "#ffffff",
},
]
}
>
Read
</Text>
</View>
</View>
</View>
<View
pointerEvents="box-none"
style={
Object {
"flexDirection": "row",
"height": 75,
"left": 0,
"position": "absolute",
"right": 0,
}
}
>
<View
style={
Object {
"backgroundColor": "#54585e",
"height": 150,
"justifyContent": "center",
"position": "absolute",
"top": 0,
"transform": Array [
Object {
"translateX": 750,
},
],
"width": 750,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "#ffffff",
"fontSize": 20,
},
undefined,
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 15,
"fontWeight": "600",
"justifyContent": "center",
"marginTop": 4,
"textAlign": "left",
},
Object {
"color": "#ffffff",
},
]
}
>
Favorite
</Text>
</View>
<View
style={
Object {
"height": 150,
"justifyContent": "center",
"position": "absolute",
"top": 0,
"transform": Array [
Object {
"translateX": 750,
},
],
"width": 750,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "#ffffff",
"fontSize": 20,
},
undefined,
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 15,
"fontWeight": "600",
"justifyContent": "center",
"marginTop": 4,
"textAlign": "left",
},
Object {
"color": "#ffffff",
},
]
}
>
Hide
</Text>
</View>
</View>
<View
style={
Object {
"transform": Array [
Object {
"translateX": 0,
},
],
}
}
>
<View
style={
Object {
"alignItems": "center",
"flexDirection": "row",
"height": 150,
"paddingLeft": 14,
}
}
>
<View
style={
Array [
Object {
"borderRadius": 4,
"height": 48,
"width": 48,
},
Object {
"marginRight": 10,
},
]
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 4,
"height": 48,
"width": 48,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"headers": undefined,
"priority": "high",
"uri": "https://open.rocket.chat/avatar/rocket.cat?format=png&size=48",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
<View
style={
Array [
Object {
"borderBottomWidth": 0.5,
"flex": 1,
"paddingRight": 14,
"paddingVertical": 10,
},
Object {
"borderColor": "#cbcbcc",
},
]
}
>
<View
style={
Array [
Object {
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
},
Object {
"flex": 1,
},
]
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "#cbced1",
"fontSize": 16,
},
Array [
Object {
"height": 16,
"textAlignVertical": "center",
"width": 16,
},
Array [
Array [
Object {
"marginRight": 4,
},
Object {
"color": "#0d0e12",
},
undefined,
],
Object {
"color": "#cbced1",
},
],
],
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"backgroundColor": "transparent",
"flex": 1,
"fontFamily": "System",
"fontSize": 17,
"fontWeight": "500",
"lineHeight": 20,
"textAlign": "left",
},
undefined,
Object {
"color": "#0d0e12",
},
]
}
>
rocket.cat
</Text>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</RCTScrollView>
`;
exports[`Storyshots Room Item Type 1`] = ` exports[`Storyshots Room Item Type 1`] = `
<RCTScrollView <RCTScrollView
style={ style={

View File

@ -12,7 +12,7 @@ const Link = React.memo(({
children, link, theme, onLinkPress children, link, theme, onLinkPress
}) => { }) => {
const handlePress = () => { const handlePress = () => {
if (!link) { if (!link || !onLinkPress) {
return; return;
} }
onLinkPress(link); onLinkPress(link);

View File

@ -117,8 +117,10 @@ class RoomItemContainer extends React.Component {
onLongPress = () => { onLongPress = () => {
const { item, onLongPress } = this.props; const { item, onLongPress } = this.props;
if (onLongPress) {
return onLongPress(item); return onLongPress(item);
} }
}
render() { render() {
const { const {

View File

@ -27,10 +27,10 @@ export const MessageTypeValues = [
value: 'rm', value: 'rm',
text: 'Message_HideType_rm' text: 'Message_HideType_rm'
}, { }, {
value: 'subscription_role_added', value: 'subscription-role-added',
text: 'Message_HideType_subscription_role_added' text: 'Message_HideType_subscription_role_added'
}, { }, {
value: 'subscription_role_removed', value: 'subscription-role-removed',
text: 'Message_HideType_subscription_role_removed' text: 'Message_HideType_subscription_role_removed'
}, { }, {
value: 'room_archived', value: 'room_archived',

View File

@ -714,7 +714,7 @@ class RoomActionsView extends React.Component {
return null; return null;
} }
if (t === 'd') { if (t === 'd' && !RocketChat.isGroupChat(room)) {
return ( return (
<List.Section> <List.Section>
<List.Separator /> <List.Separator />
@ -751,6 +751,8 @@ class RoomActionsView extends React.Component {
</List.Section> </List.Section>
); );
} }
return null;
} }
teamChannelActions = (t, room) => { teamChannelActions = (t, room) => {

View File

@ -40,6 +40,9 @@ const data = {
groups: { groups: {
private: { private: {
name: `detox-private-${ value }` name: `detox-private-${ value }`
},
alternate: {
name: `detox-alternate-${ value }`
} }
}, },
teams: { teams: {

View File

@ -40,6 +40,9 @@ const data = {
groups: { groups: {
private: { private: {
name: `detox-private-${ value }` name: `detox-private-${ value }`
},
alternate: {
name: `detox-alternate-${ value }`
} }
}, },
teams: { teams: {

View File

@ -52,18 +52,18 @@ describe('i18n', () => {
* This test might become outdated as soon as we support the language * This test might become outdated as soon as we support the language
* Although this seems to be a bad approach, that's the intention for having fallback enabled * Although this seems to be a bad approach, that's the intention for having fallback enabled
*/ */
it('OS set to available language and fallback to \'en\' on strings missing translation', async() => { // it('OS set to available language and fallback to \'en\' on strings missing translation', async() => {
await device.launchApp({ // await device.launchApp({
...defaultLaunchArgs, // ...defaultLaunchArgs,
languageAndLocale: { // languageAndLocale: {
language: "nl", // language: "nl",
locale: "nl" // locale: "nl"
} // }
}); // });
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000); // await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
await expect(element(by.id('join-workspace').and(by.label('Join a workspace')))).toBeVisible(); // Missing nl translation // await expect(element(by.id('join-workspace').and(by.label('Word lid van een werkruimte')))).toBeVisible();
await expect(element(by.id('create-workspace-button').and(by.label('Een nieuwe workspace maken')))).toBeVisible(); // await expect(element(by.id('create-workspace-button').and(by.label('Een nieuwe werkruimte aanmaken')))).toBeVisible();
}); // });
}); });
describe('Rocket.Chat language', () => { describe('Rocket.Chat language', () => {

View File

@ -6,7 +6,7 @@ const { navigateToLogin } = require('../../helpers/app');
describe('Forgot password screen', () => { describe('Forgot password screen', () => {
before(async() => { before(async() => {
await device.launchApp({ newInstance: true }); await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToLogin(); await navigateToLogin();
await element(by.id('login-view-forgot-password')).tap(); await element(by.id('login-view-forgot-password')).tap();
await waitFor(element(by.id('forgot-password-view'))).toExist().withTimeout(2000); await waitFor(element(by.id('forgot-password-view'))).toExist().withTimeout(2000);

View File

@ -6,7 +6,7 @@ const data = require('../../data');
describe('Create user screen', () => { describe('Create user screen', () => {
before(async() => { before(async() => {
await device.launchApp({ newInstance: true }); await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToRegister(); await navigateToRegister();
}); });

View File

@ -96,8 +96,8 @@ describe('Create room screen', () => {
it('should get invalid room', async() => { it('should get invalid room', async() => {
await element(by.id('create-channel-name')).typeText('general'); await element(by.id('create-channel-name')).typeText('general');
await element(by.id('create-channel-submit')).tap(); await element(by.id('create-channel-submit')).tap();
await waitFor(element(by.text(`A channel with name 'general' exists`))).toExist().withTimeout(60000); await waitFor(element(by.text(`A channel with name general exists`))).toExist().withTimeout(60000);
await expect(element(by.text(`A channel with name 'general' exists`))).toExist(); await expect(element(by.text(`A channel with name general exists`))).toExist();
await element(by.text('OK')).tap(); await element(by.text('OK')).tap();
}); });

View File

@ -191,7 +191,7 @@ describe('Room screen', () => {
await expect(element(by.id('action-sheet'))).toExist(); await expect(element(by.id('action-sheet'))).toExist();
await expect(element(by.id('action-sheet-handle'))).toBeVisible(); await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.id('action-sheet-handle')).swipe('up', 'slow', 0.5); await element(by.id('action-sheet-handle')).swipe('up', 'slow', 0.5);
await waitFor(element(by.label('Unstar')).atIndex(0)).toBeVisible().withTimeout(6000); await waitFor(element(by.label('Unstar')).atIndex(0)).toExist().withTimeout(6000);
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8); await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8);
}); });
@ -272,7 +272,7 @@ describe('Room screen', () => {
await waitFor(element(by.id('action-sheet'))).toExist().withTimeout(1000); await waitFor(element(by.id('action-sheet'))).toExist().withTimeout(1000);
await expect(element(by.id('action-sheet-handle'))).toBeVisible(); await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
await waitFor(element(by.label('Unpin'))).toBeVisible().withTimeout(2000); await waitFor(element(by.label('Unpin')).atIndex(0)).toExist().withTimeout(2000);
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8); await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.8);
}); });

View File

@ -385,7 +385,7 @@ describe('Room actions screen', () => {
it('should remove user from room', async() => { it('should remove user from room', async() => {
await openActionSheet('rocket.cat'); await openActionSheet('rocket.cat');
await element(by.label('Remove from room')).tap(); await element(by.label('Remove from room')).atIndex(0).tap();
await waitFor(element(by.label('Are you sure?'))).toExist().withTimeout(5000); await waitFor(element(by.label('Are you sure?'))).toExist().withTimeout(5000);
await element(by.label('Yes, remove user!').and(by.type('_UIAlertControllerActionView'))).tap(); await element(by.label('Yes, remove user!').and(by.type('_UIAlertControllerActionView'))).tap();
await waitFor(element(by.id('room-members-view-item-rocket.cat'))).toBeNotVisible().withTimeout(60000); await waitFor(element(by.id('room-members-view-item-rocket.cat'))).toBeNotVisible().withTimeout(60000);
@ -456,13 +456,13 @@ describe('Room actions screen', () => {
it('should set/remove as mute', async() => { it('should set/remove as mute', async() => {
await openActionSheet(user.username); await openActionSheet(user.username);
await element(by.label('Mute')).tap(); await element(by.label('Mute')).atIndex(0).tap();
await waitFor(element(by.label('Are you sure?'))).toExist().withTimeout(5000); await waitFor(element(by.label('Are you sure?'))).toExist().withTimeout(5000);
await element(by.label('Mute').and(by.type('_UIAlertControllerActionView'))).tap(); await element(by.label('Mute').and(by.type('_UIAlertControllerActionView'))).tap();
await waitForToast(); await waitForToast();
await openActionSheet(user.username); await openActionSheet(user.username);
await element(by.label('Unmute')).tap(); await element(by.label('Unmute')).atIndex(0).tap();
await waitFor(element(by.label('Are you sure?'))).toExist().withTimeout(5000); await waitFor(element(by.label('Are you sure?'))).toExist().withTimeout(5000);
await element(by.label('Unmute').and(by.type('_UIAlertControllerActionView'))).tap(); await element(by.label('Unmute').and(by.type('_UIAlertControllerActionView'))).tap();
await waitForToast(); await waitForToast();
@ -478,7 +478,7 @@ describe('Room actions screen', () => {
const channelName = `#${ data.groups.private.name }`; const channelName = `#${ data.groups.private.name }`;
await sendMessage(user, channelName, message); await sendMessage(user, channelName, message);
await openActionSheet(user.username); await openActionSheet(user.username);
await element(by.label('Ignore')).tap(); await element(by.label('Ignore')).atIndex(0).tap();
await waitForToast(); await waitForToast();
await backToActions(); await backToActions();
await tapBack(); await tapBack();
@ -497,7 +497,7 @@ describe('Room actions screen', () => {
await element(by.id('room-members-view-toggle-status')).tap(); await element(by.id('room-members-view-toggle-status')).tap();
await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toExist().withTimeout(60000); await waitFor(element(by.id(`room-members-view-item-${ user.username }`))).toExist().withTimeout(60000);
await openActionSheet(user.username); await openActionSheet(user.username);
await element(by.label('Direct message')).tap(); await element(by.label('Direct message')).atIndex(0).tap();
await waitFor(element(by.id('room-view'))).toExist().withTimeout(60000); await waitFor(element(by.id('room-view'))).toExist().withTimeout(60000);
await waitFor(element(by.id(`room-view-title-${ user.username }`))).toExist().withTimeout(60000); await waitFor(element(by.id(`room-view-title-${ user.username }`))).toExist().withTimeout(60000);
await tapBack(); await tapBack();

View File

@ -23,7 +23,7 @@ describe('Discussion', () => {
const discussionName = `${data.random} Discussion NewMessageView`; const discussionName = `${data.random} Discussion NewMessageView`;
await element(by.id('rooms-list-view-create-channel')).tap(); await element(by.id('rooms-list-view-create-channel')).tap();
await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(2000); await waitFor(element(by.id('new-message-view'))).toExist().withTimeout(2000);
await element(by.label('Create Discussion')).tap(); await element(by.label('Create Discussion')).atIndex(0).tap();
await waitFor(element(by.id('create-discussion-view'))).toExist().withTimeout(60000); await waitFor(element(by.id('create-discussion-view'))).toExist().withTimeout(60000);
await expect(element(by.id('create-discussion-view'))).toExist(); await expect(element(by.id('create-discussion-view'))).toExist();
await element(by.label('Select a Channel...')).tap(); await element(by.label('Select a Channel...')).tap();
@ -44,7 +44,7 @@ describe('Discussion', () => {
await navigateToRoom(); await navigateToRoom();
await element(by.id('messagebox-actions')).tap(); await element(by.id('messagebox-actions')).tap();
await waitFor(element(by.id('action-sheet'))).toExist().withTimeout(2000); await waitFor(element(by.id('action-sheet'))).toExist().withTimeout(2000);
await element(by.label('Create Discussion')).tap(); await element(by.label('Create Discussion')).atIndex(0).tap();
await waitFor(element(by.id('create-discussion-view'))).toExist().withTimeout(2000); await waitFor(element(by.id('create-discussion-view'))).toExist().withTimeout(2000);
await element(by.id('multi-select-discussion-name')).replaceText(discussionName); await element(by.id('multi-select-discussion-name')).replaceText(discussionName);
await waitFor(element(by.id(`create-discussion-submit`))).toExist().withTimeout(10000); await waitFor(element(by.id(`create-discussion-submit`))).toExist().withTimeout(10000);

View File

@ -72,7 +72,7 @@ describe('Threads', () => {
await expect(element(by.id('action-sheet'))).toExist(); await expect(element(by.id('action-sheet'))).toExist();
await expect(element(by.id('action-sheet-handle'))).toBeVisible(); await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
await element(by.label('Reply in Thread')).tap(); await element(by.label('Reply in Thread')).atIndex(0).tap();
await element(by.id('messagebox-input')).typeText('replied'); await element(by.id('messagebox-input')).typeText('replied');
await element(by.id('messagebox-send-message')).tap(); await element(by.id('messagebox-send-message')).tap();
await waitFor(element(by.id(`message-thread-button-${ thread }`))).toExist().withTimeout(5000); await waitFor(element(by.id(`message-thread-button-${ thread }`))).toExist().withTimeout(5000);

View File

@ -2,7 +2,7 @@ const {
device, expect, element, by, waitFor device, expect, element, by, waitFor
} = require('detox'); } = require('detox');
const data = require('../../data'); const data = require('../../data');
const { navigateToLogin, login, searchRoom } = require('../../helpers/app'); const { navigateToLogin, login, searchRoom, sleep } = require('../../helpers/app');
const { sendMessage } = require('../../helpers/data_setup') const { sendMessage } = require('../../helpers/data_setup')
async function navigateToRoom(user) { async function navigateToRoom(user) {
@ -25,15 +25,15 @@ describe('Mark as unread', () => {
describe('Usage', async() => { describe('Usage', async() => {
describe('Mark message as unread', async() => { describe('Mark message as unread', async() => {
it('should mark message as unread', async() => { it('should mark message as unread', async() => {
const message = `${ data.random }message`; const message = `${ data.random }message-mark-as-unread`;
const channelName = `@${ data.users.regular.username }`; const channelName = `@${ data.users.regular.username }`;
await sendMessage(data.users.alternate, channelName, message); await sendMessage(data.users.alternate, channelName, message);
await waitFor(element(by.label(message)).atIndex(0)).toExist().withTimeout(30000); await waitFor(element(by.label(message)).atIndex(0)).toExist().withTimeout(30000);
await sleep(300);
await element(by.label(message)).atIndex(0).longPress(); await element(by.label(message)).atIndex(0).longPress();
await expect(element(by.id('action-sheet'))).toExist(); await waitFor(element(by.id('action-sheet-handle'))).toBeVisible().withTimeout(3000);
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
await element(by.label('Mark Unread')).tap(); await element(by.label('Mark Unread')).atIndex(0).tap();
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(5000); await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(5000);
await expect(element(by.id(`rooms-list-view-item-${data.users.alternate.username}`))).toExist(); await expect(element(by.id(`rooms-list-view-item-${data.users.alternate.username}`))).toExist();
}); });

View File

@ -39,8 +39,8 @@ async function waitForToast() {
describe('Team', () => { describe('Team', () => {
const team = data.teams.private.name; const team = data.teams.private.name;
const user = data.users.alternate; const user = data.users.alternate;
const room = `private${ data.random }`; const room = `private${ data.random }-channel-team`;
const existingRoom = data.groups.private.name; const existingRoom = data.groups.alternate.name;
before(async() => { before(async() => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true }); await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });

View File

@ -44,6 +44,9 @@ stories.add('Basic', () => (
<RoomItem /> <RoomItem />
)); ));
stories.add('Touch', () => (
<RoomItem onPress={() => alert('on press')} onLongPress={() => alert('on long press')} />
));
stories.add('User', () => ( stories.add('User', () => (
<> <>