-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANDROID-14475 Subtitle color changed in lists (#356)
- Loading branch information
1 parent
b1dcc54
commit 432fb54
Showing
175 changed files
with
227 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_BOXED_32x32_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.7 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_BOXED_64x64_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_BOXED_INVERSE_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.3 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.5 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_BOXED_INVERSE_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.1 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_NORMAL_32x32_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.3 KB
library/screenshots/ListRowItemXML_BlauBrand_TYPE_NORMAL_64x64_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.1 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_32x32_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.3 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.2 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_64x64_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_INVERSE_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.9 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_INVERSE_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_NORMAL_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.6 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_NORMAL_32x32_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.3 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_NORMAL_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.3 KB
library/screenshots/ListRowItemXML_MovistarBrand_TYPE_NORMAL_64x64_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.2 KB
library/screenshots/ListRowItemXML_O2Brand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+11.4 KB
library/screenshots/ListRowItemXML_O2Brand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+17.4 KB
library/screenshots/ListRowItemXML_O2Brand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
library/screenshots/ListRowItemXML_O2Brand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.2 KB
library/screenshots/ListRowItemXML_O2Brand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
library/screenshots/ListRowItemXML_O2Brand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_BOXED_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+18.7 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_BOXED_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+16.4 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+12 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+20.6 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
library/screenshots/ListRowItemXML_O2NewBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+12.3 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_32x32.png
Oops, something went wrong.
Binary file added
BIN
+12.4 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_64x64.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+11.7 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+11.5 KB
...ry/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...ry/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+11.5 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_NORMAL_32x32.png
Oops, something went wrong.
Binary file added
BIN
+11.5 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+15.2 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_NORMAL_64x64.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
library/screenshots/ListRowItemXML_TelefonicaBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
library/screenshots/ListRowItemXML_TuBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
library/screenshots/ListRowItemXML_TuBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+17.9 KB
library/screenshots/ListRowItemXML_TuBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
library/screenshots/ListRowItemXML_TuBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.5 KB
library/screenshots/ListRowItemXML_TuBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
library/screenshots/ListRowItemXML_TuBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+12.6 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_BOXED_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_BOXED_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+13.2 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+11.4 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+17.4 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.2 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
library/screenshots/ListRowItemXML_VivoBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.4 KB
library/screenshots/ListRowItem_BlauBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+11.6 KB
library/screenshots/ListRowItem_BlauBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
library/screenshots/ListRowItem_BlauBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+13.4 KB
library/screenshots/ListRowItem_BlauBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.5 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_BOXED_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+15.2 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_BOXED_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+13.3 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.8 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.6 KB
library/screenshots/ListRowItem_MovistarBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.7 KB
library/screenshots/ListRowItem_O2Brand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.5 KB
library/screenshots/ListRowItem_O2Brand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+21.5 KB
library/screenshots/ListRowItem_O2NewBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+12.2 KB
library/screenshots/ListRowItem_O2NewBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+23.8 KB
library/screenshots/ListRowItem_O2NewBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
library/screenshots/ListRowItem_O2NewBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.9 KB
library/screenshots/ListRowItem_O2NewBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.6 KB
library/screenshots/ListRowItem_O2NewBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_BOXED_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_BOXED_64x64_dark.png
Oops, something went wrong.
Binary file added
BIN
+12.4 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+13.8 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+11.8 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_NORMAL_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_NORMAL_64x64.png
Oops, something went wrong.
Binary file added
BIN
+13.6 KB
library/screenshots/ListRowItem_TelefonicaBrand_TYPE_NORMAL_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+12 KB
library/screenshots/ListRowItem_TuBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.7 KB
library/screenshots/ListRowItem_TuBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+13.7 KB
library/screenshots/ListRowItem_VivoBrand_TYPE_BOXED_INVERSE_32x32.png
Oops, something went wrong.
Binary file added
BIN
+11.7 KB
library/screenshots/ListRowItem_VivoBrand_TYPE_BOXED_INVERSE_32x32_dark.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
library/screenshots/ListRowItem_VivoBrand_TYPE_BOXED_INVERSE_64x64.png
Oops, something went wrong.
Binary file added
BIN
+13.5 KB
library/screenshots/ListRowItem_VivoBrand_TYPE_BOXED_INVERSE_64x64_dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+143 Bytes
(100%)
library/screenshots/check_ListRowItem_with_32x32_asset.png
Oops, something went wrong.
Binary file modified
BIN
+148 Bytes
(100%)
library/screenshots/check_ListRowItem_with_64x64_asset.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
library/src/test/java/com/telefonica/mistica/compose/list/ListRowItemTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.telefonica.mistica.compose.list | ||
|
||
import androidx.compose.material.Surface | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onRoot | ||
import com.telefonica.mistica.compose.theme.MisticaTheme | ||
import com.telefonica.mistica.compose.theme.brand.Brand | ||
import com.telefonica.mistica.list.model.ImageDimensions | ||
import com.telefonica.mistica.testutils.ScreenshotsTest | ||
import com.telefonica.mistica.testutils.TestUtils | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.ParameterizedRobolectricTestRunner | ||
import org.robolectric.ParameterizedRobolectricTestRunner.Parameters | ||
|
||
@RunWith(ParameterizedRobolectricTestRunner::class) | ||
class ListRowItemTest( | ||
private val brand: Brand, | ||
private val smallAsset: Boolean, | ||
private val backgroundType: BackgroundType, | ||
private val darkTheme: Boolean, | ||
) : ScreenshotsTest() { | ||
@get:Rule | ||
val composeTestRule = createComposeRule() | ||
|
||
@Test | ||
fun `ListRowItem compose screenshot`() { | ||
composeTestRule.setContent { | ||
MisticaTheme(brand = brand, darkTheme = darkTheme) { | ||
Surface( | ||
color = MisticaTheme.colors.background | ||
) { | ||
val dimensions = if (smallAsset) { | ||
ImageDimensions(width = 32, height = 32) | ||
} else { | ||
ImageDimensions(width = 64, height = 64) | ||
} | ||
ListRowItem( | ||
title = "Title", | ||
subtitle = "Subtitle", | ||
description = "Description", | ||
backgroundType = backgroundType, | ||
isBadgeVisible = true, | ||
badge = "1", | ||
onClick = {}, | ||
listRowIcon = ListRowIcon.ImageAsset( | ||
painterResource(id = android.R.drawable.ic_lock_power_off), | ||
dimensions = ImageDimensions(width = dimensions.width, height = dimensions.height), | ||
), | ||
) | ||
} | ||
} | ||
} | ||
|
||
val screenshotSuffix = StringBuilder() | ||
screenshotSuffix.append("${backgroundType.name}_") | ||
|
||
if (smallAsset) { | ||
screenshotSuffix.append("32x32") | ||
} else { | ||
screenshotSuffix.append("64x64") | ||
} | ||
|
||
compareScreenshot( | ||
node = composeTestRule.onRoot(), | ||
component = "ListRowItem", | ||
style = null, | ||
brand = brand, | ||
darkTheme = darkTheme, | ||
extra = screenshotSuffix.toString() | ||
) | ||
} | ||
|
||
companion object { | ||
@Suppress("UNUSED") | ||
@JvmStatic | ||
@Parameters | ||
fun brands(): List<Array<Any?>> { | ||
val brands = TestUtils.getAllBrands() | ||
val smallAsset = arrayOf(false, true) | ||
val backgroundType = arrayOf(BackgroundType.TYPE_NORMAL, BackgroundType.TYPE_BOXED, BackgroundType.TYPE_BOXED_INVERSE) | ||
val darkTheme = arrayOf(false, true) | ||
|
||
return brands.flatMap { brand -> | ||
smallAsset.flatMap { isSmall -> | ||
backgroundType.flatMap { backgroundType -> | ||
darkTheme.map { darkTheme -> | ||
arrayOf(brand, isSmall, backgroundType, darkTheme) | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
122 changes: 122 additions & 0 deletions
122
library/src/test/java/com/telefonica/mistica/list/ListRowItemTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
package com.telefonica.mistica.list | ||
|
||
import android.content.Intent | ||
import android.widget.FrameLayout | ||
import androidx.test.core.app.ApplicationProvider | ||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import com.telefonica.mistica.DummyActivity | ||
import com.telefonica.mistica.R | ||
import com.telefonica.mistica.compose.theme.brand.Brand | ||
import com.telefonica.mistica.compose.theme.brand.MovistarBrand | ||
import com.telefonica.mistica.list.ListRowView.BackgroundType.Companion.TYPE_BOXED | ||
import com.telefonica.mistica.list.ListRowView.BackgroundType.Companion.TYPE_BOXED_INVERSE | ||
import com.telefonica.mistica.list.ListRowView.BackgroundType.Companion.TYPE_NORMAL | ||
import com.telefonica.mistica.list.ListRowView.Companion.TYPE_SMALL_ICON | ||
import com.telefonica.mistica.list.model.ImageDimensions | ||
import com.telefonica.mistica.testutils.ScreenshotsTest | ||
import com.telefonica.mistica.testutils.TestUtils | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.ParameterizedRobolectricTestRunner | ||
import org.robolectric.annotation.Config | ||
|
||
@RunWith(ParameterizedRobolectricTestRunner::class) | ||
class ListRowItemTest( | ||
private val brand: Brand, | ||
private val smallAsset: Boolean, | ||
@ListRowView.BackgroundType private val backgroundType: Int, | ||
) : ScreenshotsTest() { | ||
private val intent = Intent(ApplicationProvider.getApplicationContext(), DummyActivity::class.java).apply { | ||
this.putExtra(DummyActivity.EXTRA_THEME, TestUtils.getBaseThemeForBrand(brand)) | ||
} | ||
|
||
@get:Rule | ||
val rule = activityScenarioRule<DummyActivity>(intent) | ||
|
||
@Test | ||
fun `ListRowItem XML screenshot light`() { | ||
`listRowItem XML screenshot`(darkTheme = false) | ||
} | ||
|
||
@Config(qualifiers = "+night") | ||
@Test | ||
fun `ListRowItem XML screenshot dark`() { | ||
`listRowItem XML screenshot`(darkTheme = true) | ||
} | ||
|
||
private fun `listRowItem XML screenshot`(darkTheme: Boolean) { | ||
rule.scenario.onActivity { activity -> | ||
val dimensions = if (smallAsset) { | ||
ImageDimensions(width = 32, height = 32) | ||
} else { | ||
ImageDimensions(width = 64, height = 64) | ||
} | ||
val wrapper: FrameLayout = activity.findViewById(R.id.dummy_activity_wrapper) | ||
val listRowView = ListRowView(activity).apply { | ||
setAssetType( | ||
if(smallAsset) TYPE_SMALL_ICON else ListRowView.TYPE_IMAGE_1_1, | ||
dimensions = ImageDimensions(width = dimensions.width, height = dimensions.height), | ||
) | ||
setTitle("Title") | ||
setSubtitle("Subtitle") | ||
setDescription("Description") | ||
setBadge(show = true) | ||
setNumericBadge(1) | ||
setAssetDrawable(activity.getDrawable(android.R.drawable.ic_lock_power_off)) | ||
setBackgroundType(backgroundType) | ||
|
||
} | ||
|
||
wrapper.removeAllViews() | ||
wrapper.addView(listRowView) | ||
|
||
val screenshotSuffix = StringBuilder() | ||
val backgroundTypeName = when (backgroundType) { | ||
TYPE_NORMAL -> "TYPE_NORMAL" | ||
TYPE_BOXED -> "TYPE_BOXED" | ||
TYPE_BOXED_INVERSE -> "TYPE_BOXED_INVERSE" | ||
else -> "TYPE_NORMAL" | ||
|
||
} | ||
screenshotSuffix.append("${backgroundTypeName}_") | ||
|
||
if (smallAsset) { | ||
screenshotSuffix.append("32x32") | ||
} else { | ||
screenshotSuffix.append("64x64") | ||
} | ||
|
||
compareScreenshot( | ||
node = Espresso.onView(ViewMatchers.withId(R.id.dummy_activity_wrapper)), | ||
component = "ListRowItemXML", | ||
style = null, | ||
brand = brand, | ||
darkTheme = darkTheme, | ||
extra = screenshotSuffix.toString() | ||
) | ||
} | ||
} | ||
|
||
|
||
companion object { | ||
@Suppress("UNUSED") | ||
@JvmStatic | ||
@ParameterizedRobolectricTestRunner.Parameters | ||
fun brands(): List<Array<Any?>> { | ||
val brands = TestUtils.getAllBrands() | ||
val smallAsset = arrayOf(false, true) | ||
val backgroundType = arrayOf(TYPE_NORMAL, TYPE_BOXED, TYPE_BOXED_INVERSE) | ||
|
||
return brands.flatMap { brand -> | ||
smallAsset.flatMap { isSmall -> | ||
backgroundType.map { backgroundType -> | ||
arrayOf(brand, isSmall, backgroundType) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |