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
{ | |
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | |
"extends": [ | |
"config:base" | |
], | |
"labels": [ | |
"dependency-update" | |
], | |
"packageRules": [ | |
{ |
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
name: CI workflow | |
on: pull_request | |
jobs: | |
build: | |
runs-on: macos-13 | |
timeout-minutes: 30 | |
steps: |
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
allprojects { | |
apply( | |
plugin = "io.gitlab.arturbosch.detekt" | |
) | |
detekt { | |
buildUponDefaultConfig = true | |
config = files("$rootDir/gradle/detekt.yml") | |
} | |
} |
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
@HiltAndroidTest | |
class RocketsRouteTest { | |
@get:Rule(order = 0) | |
val hiltTestRule = HiltAndroidRule(this) | |
@get:Rule(order = 1) | |
val composeTestRule = createAndroidComposeRule<MainActivity>() | |
private val testRockets = generateTestRocketsFromDomain() |
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
class HiltTestRunner : AndroidJUnitRunner() { | |
override fun newApplication( | |
cl: ClassLoader?, | |
name: String?, | |
context: Context?, | |
): Application = super.newApplication(cl, HiltTestApplication::class.java.name, context) | |
} |
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
internal fun generateTestRocketsFromDomain() = listOf( | |
Rocket( | |
id = "1", | |
name = "test rocket", | |
costPerLaunch = 10_000_000, | |
firstFlight = LocalDate.parse("2022-09-25"), | |
height = 20, | |
weight = 30_000, | |
wikiUrl = "https://testrocket.com", | |
imageUrl = "https://testrocket.com/1.jpg" |
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
@Module | |
@TestInstallIn( | |
components = [SingletonComponent::class], | |
replaces = [RocketModule::class] | |
) | |
internal object FakeRocketModule { | |
fun provideFakeGetRocketsUseCase(): GetRocketsUseCase = GetRocketsUseCase { | |
flowOf( | |
Result.success(generateTestRocketsFromDomain()), |
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
class RocketsScreenTest { | |
@get:Rule | |
val composeTestRule = createAndroidComposeRule<ComponentActivity>() | |
private val testRockets = generateTestRocketsFromPresentation() | |
private lateinit var rocketContentDescription: String | |
private lateinit var errorRefreshingMessage: String | |
(...) |
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
@Composable | |
internal fun RocketsScreen( | |
uiState: RocketsUiState, | |
(...) | |
) { | |
(...) | |
if (uiState.rockets.isNotEmpty()) { | |
RocketsAvailableContent( | |
snackbarHostState = snackbarHostState, |
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
const val ROCKET_DIVIDER_TEST_TAG = "rocketDividerTestTag" | |
@Composable | |
fun RocketsListContent( | |
rocketList: List<RocketDisplayable>, | |
(...) | |
) { | |
LazyColumn(...) { | |
itemsIndexed( | |
items = rocketList, |
NewerOlder