Skip to content

Commit

Permalink
updating constraintlayout, rxjava and robolectric (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgleasain committed Sep 7, 2021
1 parent eed8eb0 commit 4f929e1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ext {
mockitoVersion = "3.3.3"
mockitoKotlinVersion = "1.6.0"
okhttpVersion = "3.13.1"
robolectricVersion = "4.1" // be aware of updating https://github.com/robolectric/robolectric/pull/4736
robolectricVersion = "4.6.1"
truthVersion = "1.0.1"
composeVersion = "1.0.1"

Expand All @@ -35,7 +35,7 @@ ext {
collection : [
ktx: "androidx.collection:collection-ktx:$androidXVersion"
],
constraintlayout: "androidx.constraintlayout:constraintlayout:1.1.3",
constraintlayout: "androidx.constraintlayout:constraintlayout:2.1.0",
lifecycle : [
runtime : "androidx.lifecycle:lifecycle-runtime:$lifecycleVersion",
extensions: "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"
Expand All @@ -62,7 +62,7 @@ ext {
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion",
kotlinReflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
robolectric : "org.robolectric:robolectric:$robolectricVersion",
rxjava : "io.reactivex.rxjava3:rxjava:3.0.4",
rxjava : "io.reactivex.rxjava3:rxjava:3.1.1",
rxandroid : "io.reactivex.rxjava3:rxandroid:3.0.0",
rxrelays : "com.jakewharton.rxrelay3:rxrelay:3.0.0",
truth : "com.google.truth:truth:$truthVersion"
Expand Down
21 changes: 21 additions & 0 deletions formula-android-tests/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,26 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.instacart.formula.ActivityUpdateTest$TestActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.instacart.formula.ActivityLifecycleEventTest$TestActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.instacart.formula.ActivityUpdateTimingTest$TestActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
import org.junit.runner.RunWith
import org.robolectric.annotation.LooperMode

@RunWith(AndroidJUnit4::class)
class FragmentFlowRenderViewTest {
Expand Down Expand Up @@ -130,6 +131,7 @@ class FragmentFlowRenderViewTest {
assertThat(activity.renderCalls).containsExactly(contract to "update").inOrder()
}

@LooperMode(LooperMode.Mode.LEGACY)
@Test fun `delegates back press to current render model`() {
navigateToTaskDetail()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
import org.junit.runner.RunWith
import org.robolectric.annotation.LooperMode

@RunWith(AndroidJUnit4::class)
class FragmentLifecycleStateTest {
Expand Down Expand Up @@ -70,6 +71,7 @@ class FragmentLifecycleStateTest {
assertThat(events).containsExactly(false, true).inOrder()
}

@LooperMode(LooperMode.Mode.LEGACY)
@Test fun `navigate forward`() {
navigateToTaskDetail()

Expand Down

0 comments on commit 4f929e1

Please sign in to comment.