Skip to content

Commit

Permalink
chore/9430-RNUpdate (#9515)
Browse files Browse the repository at this point in the history
Co-authored-by: Rachael Bontrager <[email protected]>
  • Loading branch information
Sparowhawk and rbontrager authored Sep 13, 2024
1 parent 4b96d61 commit 0738fb7
Show file tree
Hide file tree
Showing 21 changed files with 1,731 additions and 847 deletions.
2 changes: 1 addition & 1 deletion VAMobile/.detoxrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"android": {
"type": "android.apk",
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android ; ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug; cd .."
"build": "cd android ; ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug; cd .."
}
},
"devices": {
Expand Down
90 changes: 21 additions & 69 deletions VAMobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,26 @@ apply plugin: 'com.google.firebase.firebase-perf'
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
**/
react {
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
Expand Down Expand Up @@ -215,7 +169,7 @@ dependencies {
implementation jscFlavor
}

implementation 'com.android.support:multidex:2.0.1'
implementation "androidx.multidex:multidex:2.0.1"

implementation fileTree(dir: "libs", include: ["*.jar"])

Expand Down Expand Up @@ -264,8 +218,6 @@ task copyDownloadableDepsToLibs(type: Copy) {
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

// fastlane build tasks and defs
def readVersion() {
def versionFile = new File(project.rootDir, 'version.properties')
Expand Down
1 change: 1 addition & 0 deletions VAMobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/${appIconRound}"
android:theme="@style/AppTheme"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MainApplication : Application(), ReactApplication, INotificationsApplicati
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
get() = getDefaultReactHost(applicationContext, reactNativeHost)
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
>
<selector>
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
Expand Down
6 changes: 3 additions & 3 deletions VAMobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ buildscript {
minSdkVersion = 28
compileSdkVersion = 34
targetSdkVersion = 34
KOTLIN_VERSION = "1.8.0"
kotlinVersion = "1.8.0"
ndkVersion = "25.1.8937393"
KOTLIN_VERSION = "1.9.24"
kotlinVersion = "1.9.24"
ndkVersion = "26.1.10909125"
}
repositories {
google()
Expand Down
2 changes: 0 additions & 2 deletions VAMobile/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemo
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down
4 changes: 2 additions & 2 deletions VAMobile/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Mon Jul 12 10:15:29 CDT 2021
#Thu Aug 29 17:08:00 CDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 3 additions & 1 deletion VAMobile/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'VAMobile'
include ':react-native-safe-area-context'
project(':react-native-safe-area-context').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-safe-area-context/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':react-native-notifications'
include ':lottie-react-native'
project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')
Expand Down
26 changes: 14 additions & 12 deletions VAMobile/e2e/tests/Messages.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { by, device, element, expect, waitFor } from 'detox'
import { DateTime } from 'luxon'
import { setTimeout } from 'timers/promises'

import { isIOS } from 'utils/platform'

import {
CommonE2eIdConstants,
checkImages,
Expand Down Expand Up @@ -340,24 +342,24 @@ describe('Messages Screen', () => {
await element(by.text('Messages')).tap()
})

it('tap start new message and verify information', async () => {
//running on iOS only for the next few tests due to android wonkiness due to detox
it(':ios: tap start new message and verify information', async () => {
await element(by.id(MessagesE2eIdConstants.MESSAGES_ID)).scrollTo('top')
await element(by.id(CommonE2eIdConstants.START_NEW_MESSAGE_BUTTON_ID)).tap()
await expect(element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_TO_ID))).toExist()
await expect(element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_CATEGORY_ID))).toExist()
await expect(element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_MESSAGE_FIELD_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.START_NEW_MESSAGE_BUTTON_ID))).toExist()
await expect(element(by.text(MessagesE2eIdConstants.START_NEW_MESSAGE_ADD_FILES_TEXT))).toExist()
await expect(element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_ONLY_USE_MESSAGES_ID))).toExist()
})

it('new message: verify talk to the veterans crisis line now', async () => {
it(':ios: new message: verify talk to the veterans crisis line now', async () => {
await element(by.text(CommonE2eIdConstants.VETERAN_CRISIS_LINE_BTN_TEXT)).tap()
await expect(element(by.text('Veterans Crisis Line'))).toExist()
await element(by.text('Done')).tap()
})

it('verify only use messages for non-urgent needs information', async () => {
it(':ios: verify only use messages for non-urgent needs information', async () => {
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_ID)).scroll(300, 'down', NaN, 0.8)
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_ONLY_USE_MESSAGES_ID)).tap()
await expect(element(by.text('Only use messages for non-urgent needs')))
Expand Down Expand Up @@ -398,25 +400,25 @@ describe('Messages Screen', () => {
await device.enableSynchronization()
})

it('should close the messages help panel', async () => {
it(':ios: should close the messages help panel', async () => {
await element(by.id('messagesHelpCloseTestID')).tap()
})

it('verify the correct errors displayed on save', async () => {
it(':ios: verify the correct errors displayed on save', async () => {
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_SAVE_ID)).tap()
await expect(element(by.text('We need more information'))).toExist()
await expect(element(by.text('Select a care team to message')).atIndex(0)).toExist()
await expect(element(by.text('Select a category')).atIndex(0)).toExist()
await expect(element(by.text('Enter a message')).atIndex(0)).toExist()
})

it('should tap the to field and select a name', async () => {
it(':ios: should tap the to field and select a name', async () => {
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_TO_ID)).tap()
await element(by.text('VA Flagship mobile applications interface_DAYT29')).tap()
await element(by.text('Done')).tap()
})

it('should tap the category field and select a category', async () => {
it(':ios: should tap the category field and select a category', async () => {
await waitFor(element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_CATEGORY_ID)))
.toBeVisible()
.whileElement(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_ID))
Expand All @@ -426,7 +428,7 @@ describe('Messages Screen', () => {
await element(by.text('Done')).tap()
})

it('should add and delete text in the subject field', async () => {
it(':ios: should add and delete text in the subject field', async () => {
await waitFor(element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_SUBJECT_ID)))
.toBeVisible()
.whileElement(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_ID))
Expand All @@ -435,7 +437,7 @@ describe('Messages Screen', () => {
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_SUBJECT_ID)).clearText()
})

it('verify cancel action sheet display', async () => {
it(':ios: verify cancel action sheet display', async () => {
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_CANCEL_ID)).tap()
await expect(element(by.text('Delete message you started or save as draft?'))).toExist()
await expect(element(by.text("If you save as a draft, we'll remove the attachments."))).toExist()
Expand All @@ -444,13 +446,13 @@ describe('Messages Screen', () => {
await expect(element(by.text(MessagesE2eIdConstants.MESSAGE_CANCEL_KEEP_EDITING_TEXT))).toExist()
})

it('verify the previous made fields are filled on keep editing', async () => {
it(':ios: verify the previous made fields are filled on keep editing', async () => {
await element(by.text(MessagesE2eIdConstants.MESSAGE_CANCEL_KEEP_EDITING_TEXT)).tap()
await expect(element(by.text('VA Flagship mobile applications interface_DAYT29'))).toExist()
await expect(element(by.text('Medication'))).toExist()
})

it('verify the user is returned to messages inbox on delete', async () => {
it(':ios: verify the user is returned to messages inbox on delete', async () => {
await element(by.id(MessagesE2eIdConstants.START_NEW_MESSAGE_CANCEL_ID)).tap()
await element(by.text(MessagesE2eIdConstants.MESSAGE_CANCEL_DELETE_TEXT)).tap()
await expect(element(by.id(CommonE2eIdConstants.START_NEW_MESSAGE_BUTTON_ID))).toExist()
Expand Down
4 changes: 2 additions & 2 deletions VAMobile/ios/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ source "https://rubygems.org"

gem "fastlane"
gem "xcode-install"
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
3 changes: 2 additions & 1 deletion VAMobile/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ target 'VAMobile' do
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)

installer.pods_project.targets.each do |target|
Expand Down
Loading

0 comments on commit 0738fb7

Please sign in to comment.