Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Sep 26, 2024
1 parent da77bec commit f570425
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.odk.collect.android.instancemanagement.send

import android.app.Application
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import android.widget.FrameLayout
import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.matcher.ViewMatchers.assertThat
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -27,7 +27,7 @@ class ReadyToSendBannerTest {
it.setData(data)
}

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.GONE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.GONE))
}

@Test
Expand All @@ -37,12 +37,12 @@ class ReadyToSendBannerTest {
it.setData(data)
}

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.GONE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.GONE))

data = ReadyToSendViewModel.Data(1, 1, 0)
view.setData(data)

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.VISIBLE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.VISIBLE))
}

@Test
Expand All @@ -52,12 +52,12 @@ class ReadyToSendBannerTest {
it.setData(data)
}

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.VISIBLE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.VISIBLE))

data = ReadyToSendViewModel.Data(0, 0, 0)
view.setData(data)

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.GONE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.GONE))
}

@Test
Expand All @@ -67,7 +67,7 @@ class ReadyToSendBannerTest {
it.setData(data)
}

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.GONE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.GONE))
}

@Test
Expand All @@ -77,7 +77,7 @@ class ReadyToSendBannerTest {
it.setData(data)
}

assertThat(view.findViewById<ConstraintLayout>(R.id.banner).visibility, equalTo(View.GONE))
assertThat(view.findViewById<FrameLayout>(R.id.banner).visibility, equalTo(View.GONE))
}

@Test
Expand All @@ -88,7 +88,7 @@ class ReadyToSendBannerTest {
}

assertThat(
view.findViewById<ConstraintLayout>(R.id.banner).visibility,
view.findViewById<FrameLayout>(R.id.banner).visibility,
equalTo(View.VISIBLE)
)
}
Expand Down
25 changes: 18 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#You can override this in ~/.gradle/gradle.properties
android.useAndroidX=true
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true
#Thu Sep 26 09:59:52 CEST 2024
android.enableJetifier=true
#https://issuetracker.google.com/issues/283715193
android.jetifier.ignorelist = jackson-core
org.gradle.jvmargs=-Xmx1536m
android.injected.androidTest.leaveApksInstalledAfterRun=true
android.jetifier.ignorelist=jackson-core
android.nonTransitiveRClass=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.parallel=true
test.heap.max=1g
android.nonTransitiveRClass=true
android.injected.androidTest.leaveApksInstalledAfterRun=true

0 comments on commit f570425

Please sign in to comment.