mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 08:17:04 +05:30
feat(common): delete unused Paparazzi tests
This commit is contained in:
parent
293d12454f
commit
02416a3606
9 changed files with 0 additions and 89 deletions
|
@ -1,23 +0,0 @@
|
||||||
package dev.msfjarvis.claw.android.tests
|
|
||||||
|
|
||||||
import app.cash.paparazzi.Paparazzi
|
|
||||||
import app.cash.paparazzi.androidHome
|
|
||||||
import app.cash.paparazzi.detectEnvironment
|
|
||||||
import com.google.testing.junit.testparameterinjector.TestParameter
|
|
||||||
import com.google.testing.junit.testparameterinjector.TestParameterInjector
|
|
||||||
import org.junit.Rule
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
/** Base class for Paparazzi based tests that handles parameterization based on [Theme]. */
|
|
||||||
@RunWith(TestParameterInjector::class)
|
|
||||||
abstract class BasePaparazziTest {
|
|
||||||
@get:Rule
|
|
||||||
val paparazzi =
|
|
||||||
Paparazzi(
|
|
||||||
// https://github.com/cashapp/paparazzi/issues/489
|
|
||||||
environment =
|
|
||||||
detectEnvironment()
|
|
||||||
.copy(platformDir = "${androidHome()}/platforms/android-32", compileSdkVersion = 32)
|
|
||||||
)
|
|
||||||
@TestParameter lateinit var theme: Theme
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package dev.msfjarvis.claw.android.tests
|
|
||||||
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import dev.msfjarvis.claw.common.posts.LobstersCard
|
|
||||||
import dev.msfjarvis.claw.common.posts.PostActions
|
|
||||||
import dev.msfjarvis.claw.database.local.SavedPost
|
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
class LobstersCardTest : BasePaparazziTest() {
|
|
||||||
companion object {
|
|
||||||
private val post =
|
|
||||||
SavedPost(
|
|
||||||
shortId = "shortId",
|
|
||||||
title = "Title",
|
|
||||||
url = "/s/shortId",
|
|
||||||
createdAt = "2021-04-03T16:16:02.000-05:00",
|
|
||||||
commentCount = 10,
|
|
||||||
commentsUrl = "/s/shortId",
|
|
||||||
submitterName = "msfjarvis",
|
|
||||||
submitterAvatarUrl = "/msfjarvis.png",
|
|
||||||
tags = listOf("science", "technology"),
|
|
||||||
)
|
|
||||||
private val postActions =
|
|
||||||
object : PostActions {
|
|
||||||
override fun viewPost(postUrl: String, commentsUrl: String) {}
|
|
||||||
|
|
||||||
override fun viewComments(postId: String) {}
|
|
||||||
|
|
||||||
override fun viewCommentsPage(commentsUrl: String) {}
|
|
||||||
|
|
||||||
override fun toggleSave(post: SavedPost) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun verify() {
|
|
||||||
paparazzi.snapshot {
|
|
||||||
MaterialTheme(colorScheme = theme.colors) { LobstersCard(post, false, postActions) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package dev.msfjarvis.claw.android.tests
|
|
||||||
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import dev.msfjarvis.claw.common.ui.decorations.MonthHeader
|
|
||||||
import java.time.Month
|
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
class MonthHeaderTest : BasePaparazziTest() {
|
|
||||||
@Test
|
|
||||||
fun verify() {
|
|
||||||
paparazzi.snapshot { MaterialTheme(colorScheme = theme.colors) { MonthHeader(Month.APRIL) } }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package dev.msfjarvis.claw.android.tests
|
|
||||||
|
|
||||||
import androidx.compose.material3.ColorScheme
|
|
||||||
import dev.msfjarvis.claw.common.theme.DarkThemeColors
|
|
||||||
import dev.msfjarvis.claw.common.theme.LightThemeColors
|
|
||||||
|
|
||||||
enum class Theme(val colors: ColorScheme) {
|
|
||||||
Light(LightThemeColors),
|
|
||||||
Dark(DarkThemeColors),
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.3 KiB |
|
@ -3,7 +3,6 @@
|
||||||
<ManuallySuppressedIssues></ManuallySuppressedIssues>
|
<ManuallySuppressedIssues></ManuallySuppressedIssues>
|
||||||
<CurrentIssues>
|
<CurrentIssues>
|
||||||
<ID>CompositionLocalAllowlist:HTMLConverter.kt$LocalHTMLConverter</ID>
|
<ID>CompositionLocalAllowlist:HTMLConverter.kt$LocalHTMLConverter</ID>
|
||||||
<ID>EmptyFunctionBlock:LobstersCardTest.kt$LobstersCardTest.Companion.<no name provided>${}</ID>
|
|
||||||
<ID>MagicNumber:CommentEntry.kt$16</ID>
|
<ID>MagicNumber:CommentEntry.kt$16</ID>
|
||||||
<ID>MagicNumber:LobstersCard.kt$50</ID>
|
<ID>MagicNumber:LobstersCard.kt$50</ID>
|
||||||
<ID>MagicNumber:LobstersCard.kt$8</ID>
|
<ID>MagicNumber:LobstersCard.kt$8</ID>
|
||||||
|
@ -12,6 +11,5 @@
|
||||||
<ID>ModifierReused:LobstersCard.kt$Row( modifier = modifier, verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), ) { NetworkImage( url = avatarUrl, placeholder = ClawIcons.Account, contentDescription = contentDescription, modifier = modifier.requiredSize(24.dp).clip(CircleShape), ) Text(text = text, modifier = modifier, style = MaterialTheme.typography.bodyMedium) }</ID>
|
<ID>ModifierReused:LobstersCard.kt$Row( modifier = modifier, verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), ) { NetworkImage( url = avatarUrl, placeholder = ClawIcons.Account, contentDescription = contentDescription, modifier = modifier.requiredSize(24.dp).clip(CircleShape), ) Text(text = text, modifier = modifier, style = MaterialTheme.typography.bodyMedium) }</ID>
|
||||||
<ID>ModifierReused:LobstersCard.kt$Text(text = text, modifier = modifier, style = MaterialTheme.typography.bodyMedium)</ID>
|
<ID>ModifierReused:LobstersCard.kt$Text(text = text, modifier = modifier, style = MaterialTheme.typography.bodyMedium)</ID>
|
||||||
<ID>SpreadOperator:Theme.kt$(*providedValues)</ID>
|
<ID>SpreadOperator:Theme.kt$(*providedValues)</ID>
|
||||||
<ID>UnnecessaryAbstractClass:BasePaparazziTest.kt$BasePaparazziTest$BasePaparazziTest</ID>
|
|
||||||
</CurrentIssues>
|
</CurrentIssues>
|
||||||
</SmellBaseline>
|
</SmellBaseline>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue