├── .watchmanconfig ├── .husky ├── .gitignore └── pre-commit ├── app ├── translations │ └── en.json ├── constants.ts ├── router │ ├── routeNames.ts │ ├── types.ts │ ├── routeConfigs.ts │ ├── routes.ts │ └── index.tsx ├── locales.ts ├── screens │ ├── HomeScreen │ │ ├── Loadable.ts │ │ ├── style.ts │ │ ├── types.ts │ │ ├── index.tsx │ │ └── messages.ts │ └── LoginScreen │ │ ├── Loadable.ts │ │ ├── constants.ts │ │ ├── types.ts │ │ ├── style.ts │ │ ├── messages.ts │ │ ├── EmailPasswordForm │ │ ├── style.ts │ │ ├── messages.ts │ │ ├── tests │ │ │ └── index.test.tsx │ │ └── index.tsx │ │ ├── index.tsx │ │ └── tests │ │ └── index.test.tsx ├── components │ └── LanguageProvider │ │ └── index.tsx ├── theme │ ├── FullScreenLoader │ │ └── index.tsx │ ├── Text │ │ └── index.tsx │ ├── FormattedMessage │ │ └── index.tsx │ ├── Icon │ │ └── index.tsx │ ├── Button │ │ ├── tests │ │ │ └── index.test.tsx │ │ ├── IconButton │ │ │ └── index.tsx │ │ ├── style.ts │ │ └── index.tsx │ ├── Dimensions │ │ └── index.ts │ ├── Input │ │ ├── PasswordInput.tsx │ │ ├── index.tsx │ │ └── style.tsx │ ├── TouchFeedback │ │ └── index.tsx │ └── Colors.ts ├── utils │ └── testWrapper.tsx ├── api │ ├── login.ts │ └── service.ts └── i18n.ts ├── .gitattributes ├── types.d.ts ├── app.json ├── shots ├── mock.png ├── report.png ├── formTest.png ├── huskyHook.png ├── lintTask.png ├── precommit.png ├── RNTLInstall.png ├── buttonTest.png ├── huskySetup.png ├── mockConfigs.png ├── fetchMockCode.png ├── flowTestSuite.png ├── formComponent.png ├── huskyInstall.png ├── reporterTask.png ├── buttonComponent.png ├── fetchMockInstall.png ├── reporterInstall.png ├── buttonTestExecution.png ├── reporterIntegration.png └── formPasswordValidation.png ├── android ├── release-notes │ └── whatsnew-en-US ├── app │ ├── debug.keystore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── testedapp │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ └── AndroidManifest.xml │ │ └── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── testedapp │ │ │ └── ReactNativeFlipper.java │ ├── proguard-rules.pro │ ├── build_defs.bzl │ ├── BUCK │ ├── google-services.json │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── ios ├── TestedApp │ ├── Images.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── Info.plist │ ├── AppDelegate.m │ └── LaunchScreen.storyboard ├── TestedApp.xcworkspace │ └── contents.xcworkspacedata ├── TestedAppTests │ ├── Info.plist │ └── TestedAppTests.m ├── TestedApp-tvOSTests │ └── Info.plist ├── Podfile ├── TestedApp-tvOS │ └── Info.plist ├── TestedApp.xcodeproj │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── TestedApp.xcscheme │ │ │ └── TestedApp-tvOS.xcscheme │ └── project.pbxproj └── Podfile.lock ├── .buckconfig ├── lefthook.yml ├── .prettierrc.js ├── README.md ├── setup.sh ├── index.js ├── metro.config.js ├── babel.config.js ├── jest.config.js ├── tsconfig.json ├── .github └── workflows │ ├── ci.yml │ ├── develop-cd.yml │ ├── main-cd.yml │ └── aplha-cd.yml ├── App.tsx ├── .eslintrc.js ├── jest.mock.js ├── .gitignore ├── .flowconfig └── package.json /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /app/translations/en.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /types.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'fetch-mock-jest'; 2 | -------------------------------------------------------------------------------- /app/constants.ts: -------------------------------------------------------------------------------- 1 | export const API_URL = 'https://api.com'; 2 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestedApp", 3 | "displayName": "TestedApp" 4 | } -------------------------------------------------------------------------------- /shots/mock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/mock.png -------------------------------------------------------------------------------- /android/release-notes/whatsnew-en-US: -------------------------------------------------------------------------------- 1 | Alpha 1 2 | 3 | - New automated release mechanism -------------------------------------------------------------------------------- /shots/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/report.png -------------------------------------------------------------------------------- /app/router/routeNames.ts: -------------------------------------------------------------------------------- 1 | export const HOME = 'Home'; 2 | export const LOGIN = 'Login'; 3 | -------------------------------------------------------------------------------- /shots/formTest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/formTest.png -------------------------------------------------------------------------------- /shots/huskyHook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/huskyHook.png -------------------------------------------------------------------------------- /shots/lintTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/lintTask.png -------------------------------------------------------------------------------- /shots/precommit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/precommit.png -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname $0)/_/husky.sh" 3 | 4 | yarn test 5 | git add -A . -------------------------------------------------------------------------------- /app/locales.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_LOCALE = 'en'; 2 | 3 | export const appLocales = ['en']; 4 | -------------------------------------------------------------------------------- /shots/RNTLInstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/RNTLInstall.png -------------------------------------------------------------------------------- /shots/buttonTest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/buttonTest.png -------------------------------------------------------------------------------- /shots/huskySetup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/huskySetup.png -------------------------------------------------------------------------------- /shots/mockConfigs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/mockConfigs.png -------------------------------------------------------------------------------- /shots/fetchMockCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/fetchMockCode.png -------------------------------------------------------------------------------- /shots/flowTestSuite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/flowTestSuite.png -------------------------------------------------------------------------------- /shots/formComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/formComponent.png -------------------------------------------------------------------------------- /shots/huskyInstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/huskyInstall.png -------------------------------------------------------------------------------- /shots/reporterTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/reporterTask.png -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/debug.keystore -------------------------------------------------------------------------------- /shots/buttonComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/buttonComponent.png -------------------------------------------------------------------------------- /shots/fetchMockInstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/fetchMockInstall.png -------------------------------------------------------------------------------- /shots/reporterInstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/reporterInstall.png -------------------------------------------------------------------------------- /shots/buttonTestExecution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/buttonTestExecution.png -------------------------------------------------------------------------------- /shots/reporterIntegration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/reporterIntegration.png -------------------------------------------------------------------------------- /shots/formPasswordValidation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/shots/formPasswordValidation.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | TestedApp 3 | 4 | -------------------------------------------------------------------------------- /ios/TestedApp/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | # lefthook.yml 2 | 3 | ci-hook: 4 | parallel: true 5 | skip_output: true 6 | commands: 7 | lint: 8 | run: yarn lint 9 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/router/types.ts: -------------------------------------------------------------------------------- 1 | export type RootStackParamList = { 2 | Home: { 3 | [key: string]: any; 4 | }; 5 | Login: { 6 | [key: string]: any; 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zsajjad/testing-app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Testing App 2 | 3 | Demo for react native testing library 4 | 5 | Please don't judge me for coding practices using this code base. I am better than this; might be. 6 | -------------------------------------------------------------------------------- /app/screens/HomeScreen/Loadable.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Asynchronously loads the component for HomeScreen 3 | */ 4 | 5 | import loadable from 'react-suspense-loadable'; 6 | 7 | export default loadable(() => import('./index')); 8 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'TestedApp' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | yarn add -D @testing-library/react-native 2 | 3 | yarn add -D fetch-mock-jest 4 | 5 | yarn add -D jest-html-reporters 6 | 7 | yarn add -D husky 8 | 9 | npx husky add pre-commit "yarn test" # will create .husky/pre-commit file -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native'; 6 | import App from './App'; 7 | import { name as appName } from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /app/screens/LoginScreen/Loadable.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Asynchronously loads the component for LoginScreen 4 | * 5 | */ 6 | 7 | import loadable from 'react-suspense-loadable'; 8 | 9 | export default loadable(() => import('./index')); 10 | -------------------------------------------------------------------------------- /app/screens/LoginScreen/constants.ts: -------------------------------------------------------------------------------- 1 | export const AUTH_TOKEN_KEY = 'authToken'; 2 | 3 | export const TEST_ID_EMAIL_INPUT = 'emailInput'; 4 | export const TEST_ID_PASSWORD_INPUT = 'passwordInput'; 5 | export const TEST_ID_SUBMIT_BUTTON = 'submitButton'; 6 | -------------------------------------------------------------------------------- /ios/TestedApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ios/TestedApp/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/router/routeConfigs.ts: -------------------------------------------------------------------------------- 1 | import { HOME, LOGIN } from './routeNames'; 2 | 3 | const routeConfigs = { 4 | [LOGIN]: { 5 | path: '/login', 6 | }, 7 | [HOME]: { 8 | path: '/', 9 | parse: {}, 10 | }, 11 | }; 12 | 13 | export default routeConfigs; 14 | -------------------------------------------------------------------------------- /ios/TestedApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | 'module-resolver', 6 | { 7 | root: ['./app'], 8 | extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'], 9 | alias: { 10 | tests: ['./tests/'], 11 | }, 12 | }, 13 | ], 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], 4 | setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'], 5 | setupFiles: ['./jest.mock.js'], 6 | reporters: [ 7 | 'default', 8 | [ 9 | 'jest-html-reporters', 10 | { 11 | filename: 'jest.report.html', 12 | expand: true, 13 | }, 14 | ], 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/testedapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.testedapp; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "TestedApp"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/screens/HomeScreen/style.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | // import Colors from 'theme/Colors'; 3 | import Dimensions from 'theme/Dimensions'; 4 | 5 | const style = StyleSheet.create({ 6 | screen: { 7 | flex: 1, 8 | alignItems: 'center', 9 | justifyContent: 'center', 10 | }, 11 | buttonContainer: { 12 | flexDirection: 'row', 13 | padding: Dimensions.space4x, 14 | }, 15 | }); 16 | 17 | export default style; 18 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /app/screens/HomeScreen/types.ts: -------------------------------------------------------------------------------- 1 | import { RouteProp } from '@react-navigation/native'; 2 | import { StackNavigationProp } from '@react-navigation/stack'; 3 | import { RootStackParamList } from 'router/types'; 4 | 5 | type HomeScreenRouteProp = RouteProp; 6 | 7 | type HomeScreenNavigationProp = StackNavigationProp; 8 | 9 | export type HomeScreenProps = { 10 | route: HomeScreenRouteProp; 11 | navigation: HomeScreenNavigationProp; 12 | }; 13 | -------------------------------------------------------------------------------- /app/router/routes.ts: -------------------------------------------------------------------------------- 1 | import HomeScreen from 'screens/HomeScreen'; 2 | import LoginScreen from 'screens/LoginScreen'; 3 | 4 | import routeConfigs from './routeConfigs'; 5 | import * as routeNames from './routeNames'; 6 | 7 | const routes = { 8 | [routeNames.HOME]: { 9 | ...routeConfigs[routeNames.HOME], 10 | screen: HomeScreen, 11 | }, 12 | [routeNames.LOGIN]: { 13 | ...routeConfigs[routeNames.LOGIN], 14 | screen: LoginScreen, 15 | }, 16 | }; 17 | 18 | export default routes; 19 | -------------------------------------------------------------------------------- /app/screens/LoginScreen/types.ts: -------------------------------------------------------------------------------- 1 | import { RouteProp } from '@react-navigation/native'; 2 | import { StackNavigationProp } from '@react-navigation/stack'; 3 | import { RootStackParamList } from 'router/types'; 4 | 5 | type LoginScreenRouteProp = RouteProp; 6 | 7 | type LoginScreenNavigationProp = StackNavigationProp< 8 | RootStackParamList, 9 | 'Login' 10 | >; 11 | 12 | export type LoginScreenProps = { 13 | route: LoginScreenRouteProp; 14 | navigation: LoginScreenNavigationProp; 15 | }; 16 | -------------------------------------------------------------------------------- /app/screens/LoginScreen/style.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import Colors from 'theme/Colors'; 3 | // import Colors from "theme/Colors"; 4 | import Dimensions from 'theme/Dimensions'; 5 | // import elevation from "theme/elevation"; 6 | 7 | const style = StyleSheet.create({ 8 | container: { 9 | width: Dimensions.screenWidth, 10 | paddingBottom: Dimensions.bottomSpacing, 11 | paddingHorizontal: Dimensions.space2x, 12 | backgroundColor: Colors.white, 13 | flex: 1, 14 | }, 15 | }); 16 | 17 | export default style; 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowSyntheticDefaultImports": true, 5 | "esModuleInterop": true, 6 | "isolatedModules": true, 7 | "jsx": "react", 8 | "lib": [ 9 | "es6" 10 | ], 11 | "moduleResolution": "node", 12 | "noEmit": true, 13 | "strict": true, 14 | "target": "esnext", 15 | "baseUrl": "./app", 16 | "paths": { 17 | "test": [ 18 | "__tests__" 19 | ], 20 | }, 21 | }, 22 | "exclude": [ 23 | "node_modules", 24 | "babel.config.js", 25 | "metro.config.js", 26 | "jest.config.js" 27 | ] 28 | } -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - develop 7 | - alpha 8 | - main 9 | 10 | jobs: 11 | test: 12 | name: Tests 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | - uses: actions/setup-node@master 18 | - uses: c-hive/gha-yarn-cache@v1 19 | 20 | - name: Install node modules 21 | run: | 22 | yarn install 23 | 24 | - name: Run CI with Lefthook 25 | run: | 26 | yarn lefthook run ci-hook 27 | 28 | - name: Run test 29 | run: | 30 | yarn test-ci 31 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /App.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * 5 | */ 6 | 7 | import React from 'react'; 8 | import { StatusBar } from 'react-native'; 9 | 10 | import Router from 'router'; 11 | import LanguageProvider from 'components/LanguageProvider'; 12 | 13 | // import routeConfigs from 'router/routeConfigs'; 14 | import { translationMessages } from './app/i18n'; 15 | 16 | const App: React.FC = () => { 17 | return ( 18 | <> 19 | 20 | 21 | 22 | 23 | 24 | ); 25 | }; 26 | 27 | export default App; 28 | -------------------------------------------------------------------------------- /app/components/LanguageProvider/index.tsx: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * LanguageProvider 4 | * 5 | * This component connects the redux state language locale to the 6 | * IntlProvider component and i18n messages (loaded from `app/translations`) 7 | */ 8 | 9 | import React from 'react'; 10 | import { IntlProvider } from 'react-intl'; 11 | 12 | interface LanguageProps { 13 | locale: 'en'; 14 | messages: any; 15 | children?: any; 16 | } 17 | 18 | export default function LanguageProvider( 19 | props: LanguageProps, 20 | ): React.ReactChild { 21 | return ( 22 | 23 | {React.Children.only(props.children)} 24 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /ios/TestedApp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /app/router/index.tsx: -------------------------------------------------------------------------------- 1 | // import isEqual from 'lodash/isEqual'; 2 | 3 | import React from 'react'; 4 | 5 | import { NavigationContainer } from '@react-navigation/native'; 6 | import { createStackNavigator } from '@react-navigation/stack'; 7 | 8 | import routes from './routes'; 9 | import { HOME } from './routeNames'; 10 | 11 | const Stack = createStackNavigator(); 12 | 13 | function Router() { 14 | return ( 15 | 16 | 17 | {Object.keys(routes).map((routeKey) => ( 18 | 23 | ))} 24 | 25 | 26 | ); 27 | } 28 | 29 | export default Router; 30 | -------------------------------------------------------------------------------- /ios/TestedAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/TestedApp-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/theme/FullScreenLoader/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * FullScreenLoader 4 | * 5 | */ 6 | import React from 'react'; 7 | import { StyleSheet, View } from 'react-native'; 8 | 9 | import Text from 'theme/Text'; 10 | import Dimensions from 'theme/Dimensions'; 11 | import Colors from 'theme/Colors'; 12 | 13 | const style = StyleSheet.create({ 14 | container: { 15 | position: 'absolute', 16 | top: 0, 17 | left: 0, 18 | bottom: 0, 19 | right: 0, 20 | backgroundColor: Colors.translucentWhite, 21 | alignItems: 'center', 22 | justifyContent: 'center', 23 | padding: Dimensions.headerHeight, 24 | zIndex: 100000000000, 25 | elevation: 100, 26 | }, 27 | }); 28 | 29 | const FullScreenLoader: React.FC = () => ( 30 | 31 | Loading ... 32 | 33 | ); 34 | 35 | export default FullScreenLoader; 36 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '10.0' 5 | 6 | target 'TestedApp' do 7 | config = use_native_modules! 8 | 9 | use_react_native!(:path => config["reactNativePath"]) 10 | 11 | target 'TestedAppTests' do 12 | inherit! :complete 13 | # Pods for testing 14 | end 15 | 16 | # Enables Flipper. 17 | # 18 | # Note that if you have use_frameworks! enabled, Flipper will not work and 19 | # you should disable these next few lines. 20 | use_flipper! 21 | post_install do |installer| 22 | flipper_post_install(installer) 23 | end 24 | end 25 | 26 | target 'TestedApp-tvOS' do 27 | # Pods for TestedApp-tvOS 28 | 29 | target 'TestedApp-tvOSTests' do 30 | inherit! :search_paths 31 | # Pods for testing 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/screens/HomeScreen/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { HomeScreenProps } from './types'; 3 | // import Text from 'theme/Text'; 4 | import { Text, View } from 'react-native-animatable'; 5 | import style from './style'; 6 | import Button from 'theme/Button'; 7 | import { LOGIN } from 'router/routeNames'; 8 | 9 | function HomeScreen(props: HomeScreenProps): React.ReactChild { 10 | console.log('here'); 11 | return ( 12 | 13 | 14 |