diff --git a/.github/workflows/android_detox.yml b/.github/workflows/android_detox.yml
index 718c91c51..d0391191c 100644
--- a/.github/workflows/android_detox.yml
+++ b/.github/workflows/android_detox.yml
@@ -33,31 +33,10 @@ jobs:
run: |
yarn --frozen-lockfile --network-timeout 100000
- - name: Decode google-services.json
- env:
- FIREBASE_SECRET: ${{ secrets.GOOGLE_KEY }}
- run: echo $FIREBASE_SECRET > android/app/google-services.json
- - name: Generate Temporary Keystore
- run: |
- cd android
- echo -e "" > ./gradle.properties
- echo -e "android.useAndroidX=true" >> ./gradle.properties
- echo -e "android.enableJetifier=true" >> ./gradle.properties
- echo -e "FLIPPER_VERSION=0.51.0" >> ./gradle.properties
- echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
- echo -e "VERSIONCODE=99999" >> ./gradle.
- echo -e "BugsnagAPIKey=\"\"" >> ./gradle.properties
- echo -e "KEYSTORE=debug.keystore" >> ./gradle.properties
- echo -e "KEYSTORE_PASSWORD=android" >> ./gradle.properties
- echo -e "KEY_ALIAS=androiddebugkey" >> ./gradle.properties
- echo -e "KEY_PASSWORD=android" >> ./gradle.properties
- cd ..
- keytool -genkey -noprompt -dname "CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" -keystore android/app/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
-
- name: Build for detox
run: |
- yarn detox build e2e --configuration android.experimental.play.emu.release
+ yarn detox build e2e/tests --configuration android.experimental.play.emu.debug
- name: Android Emulator
timeout-minutes: 10
@@ -70,4 +49,4 @@ jobs:
echo "Emulator started"
- name: Android Detox
- run: yarn start & yarn detox test --configuration android.experimental.play.emu.release
\ No newline at end of file
+ run: yarn start & yarn detox test e2e/tests --configuration android.experimental.play.emu.debug
\ No newline at end of file
diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap
index 211e2a83d..286e506ee 100644
--- a/__tests__/__snapshots__/Storyshots.test.js.snap
+++ b/__tests__/__snapshots__/Storyshots.test.js.snap
@@ -878,29 +878,46 @@ exports[`Storyshots Avatar list Avatar 1`] = `
+ >
+
+
+
+
`;
+exports[`Storyshots BackgroundContainer basic 1`] = `
+
+
+
+
+
+`;
+
+exports[`Storyshots BackgroundContainer black theme - loading 1`] = `
+
+
+
+
+
+
+`;
+
+exports[`Storyshots BackgroundContainer black theme - text 1`] = `
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+`;
+
+exports[`Storyshots BackgroundContainer dark theme - loading 1`] = `
+
+
+
+
+
+
+`;
+
+exports[`Storyshots BackgroundContainer dark theme - text 1`] = `
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+`;
+
+exports[`Storyshots BackgroundContainer loading 1`] = `
+
+
+
+
+
+
+`;
+
+exports[`Storyshots BackgroundContainer long text 1`] = `
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+`;
+
+exports[`Storyshots BackgroundContainer text 1`] = `
+
+
+
+
+
+ Text here
+
+
+`;
+
exports[`Storyshots Header Buttons badge 1`] = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- diego.mello
-
-
-
- 10:00 AM
-
-
-
-
-
- Image should not render
-
-
-
-
-
-
-
-
-
-
-
- Value 1
+
+ Value 1
+
- Value 2
+
+ Value 2
+
- Value 3
+
+ Value 3
+
- Value 4
+
+ Value 4
+
- Value 5
+
+ Value 5
+
@@ -39816,7 +40220,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
- Two short custom fields
+ Two short custom fields with markdown
- Value 1
+
+ Value 1
+
- Value 2
+
+
+ Value 2
+
+
@@ -40466,17 +40946,44 @@ exports[`Storyshots Message list message 1`] = `
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
- "fontSize": 14,
+ "fontSize": 16,
"fontWeight": "400",
"textAlign": "left",
},
+ undefined,
Object {
"color": "#2f343d",
},
]
}
>
- Value 1
+
+ Value 1
+
+
+ Value 2
+
+
+
+
+
+
+
+
+
+
+
+
+ Colored attachments
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ diego.mello
+
+
+
+ 10:00 AM
+
+
+
+
+
+
+
+
- Value 2
+ Field 1
+
+
+
+ Value 1
+
+
+
+
+
+ Field 2
+
+
+
+ Value 2
+
+
+
+
+
+
+
+
+
+
+
+ Field 1
+
+
+
+ Value 1
+
+
+
+
+
+ Field 2
+
+
+
+ Value 2
+
+
+
+
+
+
+
+
+
+
+
+ Field 1
+
+
+
+ Value 1
+
+
+
+
+
+ Field 2
+
+
+
+ Value 2
+
+
+
+
+
+
+
+
+
+
+
+ Invalid color
@@ -44679,6 +46110,309 @@ exports[`Storyshots Message list message 1`] = `
+
+ Toggle e2e encryption
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This room's encryption has been disabled by diego.mello
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This room's encryption has been enabled by diego.mello
+
+
+
+
+
+
+
+ Starting with empty link
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ diego.mello
+
+
+
+ 10:00 AM
+
+
+
+
+
+ <- No link should render
+
+
+
+
+
+
+
+
`;
+exports[`Storyshots RoomHeader icons 1`] = `
+Array [
+
+
+
+
+
+
+
+
+
+ private channel
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ public channel
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ discussion
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ omnichannel
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ private team
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ public team
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ group dm
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ online dm
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ away dm
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ busy dm
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ loading dm
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ offline dm
+
+
+
+
+
+ ,
+]
+`;
+
+exports[`Storyshots RoomHeader landscape 1`] = `
+Array [
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+ subtitle
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+
+ ,
+]
+`;
+
+exports[`Storyshots RoomHeader themes 1`] = `
+Array [
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+ subtitle
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+ subtitle
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+ subtitle
+
+
+
+
+ ,
+]
+`;
+
+exports[`Storyshots RoomHeader thread 1`] = `
+Array [
+
+
+
+
+
+
+ title
+
+
+
+
+
+
+
+ parent title
+
+
+
+
+
+ ,
+
+
+
+
+
+
+ markdown preview #3 4 5
+
+
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+
+
+ ,
+]
+`;
+
+exports[`Storyshots RoomHeader title and subtitle 1`] = `
+Array [
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+ subtitle
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries
+
+
+
+
+ ,
+]
+`;
+
+exports[`Storyshots RoomHeader typing 1`] = `
+Array [
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+
+ user 1
+
+
+ is typing
+ ...
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+
+ user 1 and user 2
+
+
+ are typing
+ ...
+
+
+
+
+ ,
+
+
+
+
+
+
+
+
+
+ title
+
+
+
+
+ user 1, user 2, user 3, user 4, user 5
+
+
+ are typing
+ ...
+
+
+
+
+ ,
+]
+`;
+
exports[`Storyshots RoomItem list roomitem 1`] = `
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+
+
+
+ rocket.cat
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Read
+
+
+
+
+
+
+
+
+
+
+ Favorite
+
+
+
+
+
+
+
+ Hide
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
-
+ >
+
+
{
- if (file.type === 'file' && file.image_url) {
+ if (file.image_url) {
return ;
}
- if (file.type === 'file' && file.audio_url) {
+ if (file.audio_url) {
return ;
}
- if (file.type === 'file' && file.video_url) {
+ if (file.video_url) {
return ;
}
// eslint-disable-next-line react/no-array-index-key
return ;
});
-}, (prevProps, nextProps) => isEqual(prevProps.attachments, nextProps.attachments) && prevProps.theme === nextProps.theme);
+}, (prevProps, nextProps) => dequal(prevProps.attachments, nextProps.attachments) && prevProps.theme === nextProps.theme);
Attachments.propTypes = {
attachments: PropTypes.array,
diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js
index 0d4e8a121..7be131dbc 100644
--- a/storybook/stories/Message.js
+++ b/storybook/stories/Message.js
@@ -346,21 +346,13 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
- image_url: '/dummypath',
- type: 'file'
+ image_url: '/dummypath'
}]}
/>
-
@@ -370,15 +362,13 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
- video_url: '/dummypath',
- type: 'file'
+ video_url: '/dummypath'
}]}
/>
@@ -387,8 +377,7 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
- audio_url: '/dummypath',
- type: 'file'
+ audio_url: '/dummypath'
}]}
/>
@@ -396,24 +385,21 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
- audio_url: '/dummypath',
- type: 'file'
+ audio_url: '/dummypath'
}]}
isHeader={false}
/>
@@ -440,7 +426,8 @@ export default ({ theme }) => {
author_name: 'I\'m a very long long title and I\'ll break',
ts: date,
timeFormat: 'LT',
- text: 'How are you?'
+ text: 'How are you?',
+ message_link: 'http:///example.com'
}]}
/>
{
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
- text: 'How are you? :nyan_rocket:'
+ text: 'How are you? :nyan_rocket:',
+ message_link: 'http:///example.com'
}]}
/>
@@ -577,8 +565,7 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
- audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac',
- type: 'file'
+ audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
tmid='1'
isThreadSequential
@@ -702,6 +689,7 @@ export default ({ theme }) => {
ts: date,
timeFormat: 'LT',
text: 'Custom fields',
+ message_link: 'http:///example.com',
fields: [{
title: 'Field 1',
value: 'Value 1'
@@ -721,7 +709,7 @@ export default ({ theme }) => {
}]}
/>
-
+
{
ts: date,
timeFormat: 'LT',
text: 'Custom fields',
+ message_link: 'http:///example.com',
+ fields: [{
+ title: 'Field 1',
+ value: 'Value 1',
+ short: true
+ }, {
+ title: 'Field 2',
+ value: '[Value 2](https://google.com/)',
+ short: true
+ }]
+ }, {
+ author_name: 'rocket.cat',
+ ts: date,
+ timeFormat: 'LT',
+ text: 'Custom fields 2',
+ message_link: 'http:///example.com',
+ fields: [{
+ title: 'Field 1',
+ value: 'Value 1',
+ short: true
+ }, {
+ title: 'Field 2',
+ value: '**Value 2**',
+ short: true
+ }]
+ }]}
+ />
+
+
+ {
short: true
}]
}, {
- author_name: 'rocket.cat',
- ts: date,
- timeFormat: 'LT',
- text: 'Custom fields 2',
+ color: 'green',
fields: [{
title: 'Field 1',
value: 'Value 1',
@@ -752,6 +769,23 @@ export default ({ theme }) => {
value: 'Value 2',
short: true
}]
+ }, {
+ color: 'blue',
+ fields: [{
+ title: 'Field 1',
+ value: 'Value 1',
+ short: true
+ }, {
+ title: 'Field 2',
+ value: 'Value 2',
+ short: true
+ }]
+ }, {
+ color: 'ASDASD',
+ fields: [{
+ title: 'Invalid color',
+ short: true
+ }]
}]}
/>
@@ -789,6 +823,7 @@ export default ({ theme }) => {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
+ message_link: 'http:///example.com',
text: 'First message'
}]}
/>
@@ -836,6 +871,10 @@ export default ({ theme }) => {
+
+
+
+
@@ -858,6 +897,9 @@ export default ({ theme }) => {
+
+
+