Upload via GUI (67 Dateien)
This commit is contained in:
@@ -29,8 +29,8 @@ android {
|
|||||||
// WICHTIG: Bei jedem neuen Debug-Build erhöhen. Android erkennt eine APK mit
|
// WICHTIG: Bei jedem neuen Debug-Build erhöhen. Android erkennt eine APK mit
|
||||||
// unverändertem versionCode (+ gleicher Signatur) auf manchen Geräten nicht
|
// unverändertem versionCode (+ gleicher Signatur) auf manchen Geräten nicht
|
||||||
// zuverlässig als Update, wodurch eine Neuinstallation still fehlschlagen kann.
|
// zuverlässig als Update, wodurch eine Neuinstallation still fehlschlagen kann.
|
||||||
versionCode = 30
|
versionCode = 41
|
||||||
versionName = "2.6.1"
|
versionName = "3.1.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package de.deskhub.staff
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.RemoteViews
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.test.core.app.ApplicationProvider
|
||||||
|
import org.junit.Assert.assertNotNull
|
||||||
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
import org.robolectric.RobolectricTestRunner
|
||||||
|
import org.robolectric.annotation.Config
|
||||||
|
|
||||||
|
/** Stellt sicher, dass alle drei Widget-Größen sich zeichnen lassen und die Felder vorhanden sind, die der Code befüllt. */
|
||||||
|
@RunWith(RobolectricTestRunner::class)
|
||||||
|
@Config(sdk = [34])
|
||||||
|
class WidgetLayoutTest {
|
||||||
|
private val context: Context = ApplicationProvider.getApplicationContext()
|
||||||
|
|
||||||
|
private fun inflate(layout: Int) = RemoteViews(context.packageName, layout).apply(context, FrameLayout(context))
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun smallHasTwoTiles() {
|
||||||
|
val v = inflate(R.layout.widget_deskhub_small)
|
||||||
|
assertNotNull(v.findViewById<TextView>(R.id.widget_my_open))
|
||||||
|
assertNotNull(v.findViewById<TextView>(R.id.widget_overdue))
|
||||||
|
assertNotNull(v.findViewById<TextView>(R.id.widget_refresh))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun mediumHasFourTilesAndTicketChips() {
|
||||||
|
val v = inflate(R.layout.widget_deskhub)
|
||||||
|
listOf(R.id.widget_my_open, R.id.widget_unassigned, R.id.widget_overdue, R.id.widget_unanswered, R.id.widget_t1, R.id.widget_t2, R.id.widget_t3)
|
||||||
|
.forEach { assertNotNull(v.findViewById<TextView>(it)) }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun largeAddsButtonsAndStatusRow() {
|
||||||
|
val v = inflate(R.layout.widget_deskhub_large)
|
||||||
|
listOf(R.id.widget_btn_new, R.id.widget_btn_tickets, R.id.widget_st_available, R.id.widget_st_busy, R.id.widget_st_break, R.id.widget_st_offline, R.id.widget_t3)
|
||||||
|
.forEach { assertNotNull(v.findViewById<TextView>(it)) }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user