-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Unit Tests for AndroidHealthConnect Inventory Item (#3)
* feat: Add unit tests for AndroidHealthConnect inventory * feat: Updated src/utils/inventory/android-health-c * finalize initial android health tests * format sweep config * merge upstream * add deployment environment to env vars and include in analytics * sign api requests and include in query vars for authentication --------- Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com> Co-authored-by: kibagateaux <[email protected]>
- Loading branch information
1 parent
174a58d
commit 7d0b3f5
Showing
19 changed files
with
412 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
createClient: jest.fn(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
openHealthConnectSettings: jest.fn(), | ||
// assume installed for testing purposes. not worth getting into weeds | ||
initialize: jest.fn(), | ||
getSdkStatus: jest.fn(), | ||
requestPermission: jest.fn(), | ||
readRecords: jest.fn(), | ||
revokeAllPermissions: jest.fn(), | ||
getGrantedPermissions: jest.fn(), | ||
SdkAvailabilityStatus: jest.fn(), | ||
SdkAvailabilityStatus: { | ||
SDK_UNAVAILABLE: 1, | ||
SDK_UNAVAILABLE_PROVIDER_UPDATE_REQUIRED: 2, | ||
SDK_AVAILABLE: 3, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
Native: { | ||
captureException: jest.fn(), | ||
captureMessage: jest.fn(), | ||
}, | ||
Browser: { | ||
captureException: jest.fn(), | ||
captureMessage: jest.fn(), | ||
}, | ||
init: jest.fn(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
const isProd = process.env.EXPO_PUBLIC_APP_VARIANT === 'production'; | ||
|
||
const packageName = isProd ? 'com.jinnihealth' : `com.jinnihealth.${VARIANT}`; | ||
const appName = isProd ? 'Jinni Health' : `Jinni Health (${VARIANT})`; | ||
export default { | ||
expo: { | ||
name: appName, | ||
slug: 'jinni-health', | ||
version: '0.0.1', | ||
orientation: 'portrait', | ||
icon: './public/icon.png', | ||
userInterfaceStyle: 'light', | ||
splash: { | ||
image: './public/splash.png', | ||
resizeMode: 'contain', | ||
backgroundColor: '#ffffff', | ||
}, | ||
assetBundlePatterns: ['**/*'], | ||
scheme: 'jinni-health', | ||
plugins: [ | ||
'react-native-health', | ||
'react-native-health-connect', | ||
'react-native-nfc-manager', | ||
[ | ||
'expo-build-properties', | ||
{ | ||
ios: { | ||
deploymentTarget: '16.0', | ||
}, | ||
android: { | ||
compileSdkVersion: 34, | ||
targetSdkVersion: 34, | ||
minSdkVersion: 26, | ||
}, | ||
}, | ||
], | ||
[ | ||
'expo-contacts', | ||
{ | ||
contactsPermission: | ||
'Allow your jinni to access your friends list to contact their jinn and communicate with them in the spiritual world.', | ||
}, | ||
], | ||
[ | ||
'expo-location', | ||
{ | ||
locationAlwaysAndWhenInUsePermission: | ||
'Allow your jinni to follow you and protect you around the world.', | ||
isAndroidBackgroundLocationEnabled: false, | ||
}, | ||
], | ||
'expo-router', | ||
'sentry-expo', | ||
], | ||
hooks: { | ||
postPublish: [ | ||
{ | ||
file: 'sentry-expo/upload-sourcemaps', | ||
config: { | ||
organization: '${EXPO_PUBLIC_SENTRY_ORG}', | ||
project: '${EXPO_PUBLIC_SENTRY_PROJECT}', | ||
}, | ||
}, | ||
], | ||
}, | ||
ios: { | ||
supportsTablet: false, | ||
infoPlist: { | ||
NSContactsUsageDescription: | ||
'Allow your jinni to access your friends list to contact their jinn and communicate with them in the spiritual world.', | ||
}, | ||
bundleIdentifier: packageName, | ||
}, | ||
android: { | ||
adaptiveIcon: { | ||
foregroundImage: './public/adaptive-icon.png', | ||
backgroundColor: '#ffffff', | ||
}, | ||
permissions: [ | ||
'android.permission.NFC', | ||
'android.permission.READ_CONTACTS', | ||
'android.permission.WRITE_CONTACTS', | ||
'android.permission.health.READ_STEPS', | ||
'android.permission.health.READ_ACTIVE_CALORIES_BURNED', | ||
'android.permission.health.READ_TOTAL_CALORIES_BURNED', | ||
'android.permission.health.READ_BASAL_METABOLIC_RATE', | ||
'android.permission.health.READ_LEAN_BODY_MASS', | ||
'android.permission.health.READ_BODY_FAT', | ||
'android.permission.health.READ_EXERCISE', | ||
'android.permission.health.READ_DISTANCE', | ||
'android.permission.health.READ_HEART_RATE', | ||
'android.permission.health.READ_NUTRITION', | ||
'android.permission.health.READ_HYDRATION', | ||
'android.permission.health.READ_RESPIRATORY_RATE', | ||
'android.permission.health.READ_RESTING_HEART_RATE', | ||
'android.permission.health.READ_SLEEP', | ||
'android.permission.health.READ_WEIGHT', | ||
'android.permission.ACCESS_COARSE_LOCATION', | ||
'android.permission.ACCESS_FINE_LOCATION', | ||
'android.permission.FOREGROUND_SERVICE', | ||
], | ||
package: packageName, | ||
}, | ||
experiments: { | ||
typedRoutes: true, | ||
tsconfigPaths: true, | ||
}, | ||
extra: { | ||
router: { | ||
origin: false, | ||
}, | ||
eas: { | ||
projectId: '9d90a8bf-a538-49f0-925c-afd83fd4c8d3', | ||
}, | ||
}, | ||
owner: 'malik2', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
jest.mock('sentry-expo'); | ||
jest.mock('@segment/analytics-react-native'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.