Skip to content

Commit

Permalink
Merge branch 'develop' into feature/_merge-pinch-and-interact-with-sc…
Browse files Browse the repository at this point in the history
…reen-element_together
  • Loading branch information
sds100 committed Jun 15, 2024
2 parents cb9f732 + 3f17f3f commit c494c6a
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 38 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,35 @@ concurrency:
cancel-in-progress: true

jobs:
style:
name: Code style check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- 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: Ktlint check
run: ./gradlew ktlintCheck

apk:
name: Generate and upload APK to Discord
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.DelayController
import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.TestCoroutineExceptionHandler
import kotlinx.coroutines.test.createTestCoroutineScope
Expand All @@ -26,6 +27,7 @@ import org.mockito.kotlin.mock
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import kotlin.coroutines.ContinuationInterceptor

/**
* Created by sds100 on 25/04/2021.
Expand Down Expand Up @@ -89,14 +91,14 @@ class NotificationControllerTest {
coroutineScope.runBlockingTest {
// WHEN

pauseDispatcher()
(coroutineContext[ContinuationInterceptor]!! as DelayController).pauseDispatcher()
launch {
onActionClick.emit(NotificationController.ACTION_ON_SETUP_CHOSEN_DEVICES_AGAIN)
}

// THEN
assertThat(controller.openApp.toListWithTimeout().size, `is`(1))
resumeDispatcher()
(coroutineContext[ContinuationInterceptor]!! as DelayController).resumeDispatcher()

assertThat(fakeOnboarding.approvedSetupChosenDevicesAgainNotification, `is`(true))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.TestCoroutineExceptionHandler
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.createTestCoroutineScope
import kotlinx.coroutines.test.runBlockingTest
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.atLeast
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.times
import org.mockito.kotlin.verify

/**
* Created by sds100 on 15/05/2021.
Expand Down Expand Up @@ -159,7 +165,10 @@ class SimpleMappingControllerTest {

// WHEN
controller.onDetected("id", FakeMapping(actionList = listOf(action)))
advanceTimeBy(200)
testScheduler.apply {
advanceTimeBy(200)
runCurrent()
}
controller.onDetected("id", FakeMapping(actionList = listOf(action)))

// THEN
Expand All @@ -182,7 +191,10 @@ class SimpleMappingControllerTest {

// WHEN
controller.onDetected("id", FakeMapping(actionList = listOf(action)))
advanceTimeBy(5000)
testScheduler.apply {
advanceTimeBy(5000)
runCurrent()
}
controller.onDetected("id", FakeMapping(actionList = listOf(action)))

// THEN
Expand Down
Loading

0 comments on commit c494c6a

Please sign in to comment.