From 846f78119e6bf4788d390eedf3b32289ff7f4b3c Mon Sep 17 00:00:00 2001 From: Anant Bhasin Date: Fri, 9 Apr 2021 23:57:39 +0530 Subject: [PATCH] final for now --- .github/workflows/android_detox.yml | 25 +- .../__snapshots__/Storyshots.test.js.snap | 8333 +++++++++++++++-- app/containers/message/Attachments.js | 10 +- storybook/stories/Message.js | 102 +- 4 files changed, 7811 insertions(+), 659 deletions(-) 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