-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GT-2322 Create Preview and snapshot of isForcedName
Co-Authored-By: Daniel Frett <[email protected]>
- Loading branch information
1 parent
66a9374
commit bd659b4
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
....cru.godtools.ui.languages_LanguageNamePaparazziTest_LanguageNames()[NIGHT].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...u.godtools.ui.languages_LanguageNamePaparazziTest_LanguageNames()[NOTNIGHT].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions
39
app/src/testDebug/kotlin/org/cru/godtools/ui/languages/LanguageNamePaparazziTest.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,39 @@ | ||
package org.cru.godtools.ui.languages | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.HorizontalDivider | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.android.ide.common.rendering.api.SessionParams.RenderingMode | ||
import com.android.resources.NightMode | ||
import com.google.testing.junit.testparameterinjector.TestParameter | ||
import com.google.testing.junit.testparameterinjector.TestParameterInjector | ||
import java.util.Locale | ||
import org.cru.godtools.model.Language | ||
import org.cru.godtools.ui.BasePaparazziTest | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(TestParameterInjector::class) | ||
class LanguageNamePaparazziTest(@TestParameter nightMode: NightMode) : | ||
BasePaparazziTest(nightMode = nightMode, renderingMode = RenderingMode.SHRINK) { | ||
private val forcedNameLanguage = Language( | ||
code = Locale.ENGLISH, | ||
name = "Forced Language Name", | ||
isForcedName = true, | ||
) | ||
|
||
@Test | ||
fun `LanguageNames()`() = centerInSnapshot { | ||
Column(Modifier.padding(16.dp)) { | ||
LanguageName(Locale("ar")) | ||
HorizontalDivider() | ||
LanguageName(Locale.forLanguageTag("bs-BA")) | ||
HorizontalDivider() | ||
LanguageName(Locale.ENGLISH) | ||
HorizontalDivider() | ||
LanguageName(language = forcedNameLanguage) | ||
} | ||
} | ||
} |