Skip to content

Commit

Permalink
Merge pull request #1309 from keymapperorg/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
sds100 authored Sep 29, 2024
2 parents b7d6a9c + b18a2cb commit 5b67bec
Show file tree
Hide file tree
Showing 25 changed files with 359 additions and 730 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ concurrency:
cancel-in-progress: true

jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: 17
cache: 'gradle'

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Unit tests
run: bash ./gradlew testDebugUnitTest

apk:
name: Build and release to production
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ on:
pull_request:

jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: 17
cache: 'gradle'

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Unit tests
run: bash ./gradlew testDebugUnitTest

style:
name: Code style check
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ concurrency:
cancel-in-progress: true

jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: 17
cache: 'gradle'

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Unit tests
run: bash ./gradlew testDebugUnitTest

style:
name: Code style check
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dependencies {
compileOnly project(':systemstubs')

def room_version = "2.6.1"
def coroutinesVersion = "1.5.0"
def coroutinesVersion = "1.9.0"
def nav_version = '2.7.7'
def work_version = "2.9.1"
def epoxy_version = "4.6.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class NotificationController(
/**
* Open the app and use the String as the Intent action.
*/
private val _openApp: MutableSharedFlow<String?> = MutableSharedFlow()
val openApp: SharedFlow<String?> = _openApp.asSharedFlow()
private val _openApp: MutableSharedFlow<String> = MutableSharedFlow()
val openApp: SharedFlow<String> = _openApp.asSharedFlow()

private val _showToast = MutableSharedFlow<String>()
val showToast = _showToast.asSharedFlow()
Expand Down Expand Up @@ -213,7 +213,7 @@ class NotificationController(
ACTION_STOP_SERVICE -> controlAccessibilityService.stopService()

ACTION_DISMISS_TOGGLE_MAPPINGS -> manageNotifications.dismiss(ID_TOGGLE_MAPPINGS)
ACTION_OPEN_KEY_MAPPER -> _openApp.emit(null)
ACTION_OPEN_KEY_MAPPER -> _openApp.emit("")
ACTION_SHOW_IME_PICKER -> showImePicker.show(fromForeground = false)
ACTION_SHOW_KEYBOARD -> hideInputMethod.show()
ACTION_TOGGLE_KEYBOARD -> toggleCompatibleIme.toggle().onSuccess {
Expand All @@ -224,12 +224,12 @@ class NotificationController(

ACTION_FINGERPRINT_GESTURE_FEATURE -> {
onboardingUseCase.approvedFingerprintFeaturePrompt = true
_openApp.emit(null)
_openApp.emit("")
}

ACTION_ON_SETUP_CHOSEN_DEVICES_AGAIN -> {
onboardingUseCase.approvedSetupChosenDevicesAgainNotification()
_openApp.emit(null)
_openApp.emit("")
}
}
}.flowOn(dispatchers.default()).launchIn(coroutineScope)
Expand Down

This file was deleted.

Loading

0 comments on commit 5b67bec

Please sign in to comment.