Skip to content

Commit feb3958

Browse files
committed
Bump most deps
1 parent b384df1 commit feb3958

File tree

7 files changed

+46
-45
lines changed

7 files changed

+46
-45
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
-resultBundlePath TestResults
6363
6464
- name: Publish iOS results
65-
uses: kishikawakatsumi/[email protected].0
65+
uses: kishikawakatsumi/[email protected].1
6666
if: always()
6767
with:
6868
title: iOS results

android/src/main/kotlin/com/jdamcd/runlog/android/login/LoginActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LoginActivity : ComponentActivity() {
4949
}
5050
}
5151

52-
override fun onNewIntent(intent: Intent?) {
52+
override fun onNewIntent(intent: Intent) {
5353
super.onNewIntent(intent)
5454
setIntent(intent)
5555
}

android/src/main/kotlin/com/jdamcd/runlog/android/training/ActivityViewModel.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ class ActivityViewModel @Inject constructor(
2222
) : ViewModel(),
2323
LifecycleObserver {
2424

25-
private val id: Long
25+
private val id: Long = savedStateHandle.get<Long>(ROUTE_ACTIVITY_ID)!!
2626

2727
private val _flow = MutableStateFlow<ActivityState>(ActivityState.Loading)
2828
val flow = _flow as StateFlow<ActivityState>
2929

3030
init {
31-
id = savedStateHandle.get<Long>(ROUTE_ACTIVITY_ID)!!
3231
load()
3332
}
3433

android/src/test/kotlin/com/jdamcd/runlog/android/profile/ProfileViewModelTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ProfileViewModelTest {
2929
@Test
3030
fun `emits initial loading state`() = runTest {
3131
every { stravaProfile.profileFlow() } returns MutableSharedFlow()
32+
coEvery { stravaProfile.refresh() } returns RefreshState.LOADING
3233

3334
val viewModel = ProfileViewModel(stravaProfile)
3435

@@ -42,6 +43,7 @@ class ProfileViewModelTest {
4243
fun `emits loading then data`() = runTest {
4344
val profileFlow = MutableSharedFlow<Result<AthleteProfile>>()
4445
every { stravaProfile.profileFlow() } returns profileFlow
46+
coEvery { stravaProfile.refresh() } returns RefreshState.LOADING
4547

4648
val viewModel = ProfileViewModel(stravaProfile)
4749

android/src/test/kotlin/com/jdamcd/runlog/android/training/ActivityViewModelTest.kt

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,50 @@ import io.mockk.mockk
1313
import io.mockk.verify
1414
import kotlinx.coroutines.ExperimentalCoroutinesApi
1515
import kotlinx.coroutines.test.runTest
16-
import org.junit.Before
1716
import org.junit.Rule
1817
import org.junit.Test
1918

2019
@ExperimentalCoroutinesApi
2120
class ActivityViewModelTest {
2221

23-
@get:Rule
24-
val coroutineRule = TestCoroutinesRule()
22+
@get:Rule val coroutineRule = TestCoroutinesRule()
2523

2624
private val stravaActivity: StravaActivity = mockk()
2725
private val activityDetails: ActivityDetails = mockk()
2826

29-
private lateinit var viewModel: ActivityViewModel
27+
private val savedState = SavedStateHandle(initialState = mapOf("id" to 123L))
3028

31-
@Before
32-
fun setUp() {
33-
val state = SavedStateHandle(initialState = mapOf("id" to 123L))
34-
viewModel = ActivityViewModel(state, stravaActivity)
29+
@Test
30+
fun `emits initial loading state`() = runTest {
31+
coEvery { stravaActivity.activityDetails(123L) } returns Result.Empty
32+
33+
val viewModel = ActivityViewModel(savedState, stravaActivity)
34+
35+
viewModel.flow.test {
36+
awaitItem() shouldBe ActivityState.Loading
37+
cancelAndConsumeRemainingEvents()
38+
}
3539
}
3640

3741
@Test
38-
fun `load success emits loading then data`() = runTest {
42+
fun `load success emits data`() = runTest {
3943
coEvery { stravaActivity.activityDetails(123L) } returns Result.Data(activityDetails)
4044

41-
viewModel.flow.test {
42-
viewModel.load()
45+
val viewModel = ActivityViewModel(savedState, stravaActivity)
4346

44-
awaitItem() shouldBe ActivityState.Loading
47+
viewModel.flow.test {
4548
awaitItem() shouldBe ActivityState.Data(activityDetails)
4649
cancelAndConsumeRemainingEvents()
4750
}
4851
}
4952

5053
@Test
51-
fun `load failure emits loading then error`() = runTest {
52-
coEvery { stravaActivity.activityDetails(123L) } returns Result.Error(Throwable())
54+
fun `load failure emits error`() = runTest {
55+
coEvery { stravaActivity.activityDetails(123L) } returns Result.Error(Exception())
5356

54-
viewModel.flow.test {
55-
viewModel.load()
57+
val viewModel = ActivityViewModel(savedState, stravaActivity)
5658

57-
awaitItem() shouldBe ActivityState.Loading
59+
viewModel.flow.test {
5860
awaitItem() shouldBe ActivityState.Error
5961
cancelAndConsumeRemainingEvents()
6062
}
@@ -63,8 +65,9 @@ class ActivityViewModelTest {
6365
@Test
6466
fun `generateLink forwards ID to make URL`() {
6567
every { stravaActivity.linkUrl(123L) } returns "url/123"
68+
coEvery { stravaActivity.activityDetails(123L) } returns Result.Empty
6669

67-
viewModel.activityWebLink()
70+
ActivityViewModel(savedState, stravaActivity).activityWebLink()
6871

6972
verify { stravaActivity.linkUrl(123L) }
7073
}

buildSrc/src/main/kotlin/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ object AppConfig {
99

1010
object AndroidVersion {
1111
const val minimum = 26
12-
const val target = 33
12+
const val target = 35
1313
}

gradle/libs.versions.toml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,31 @@ spotless = "6.25.0"
77
ktlint = "1.4.1"
88

99
# Shared
10-
ktor = "2.1.2"
11-
coroutines = "1.6.4-native-mt"
12-
koin = "3.2.2"
10+
ktor = "3.0.1"
11+
coroutines = "1.9.0"
12+
koin = "3.5.6"
1313
sqlDelight = "1.5.5"
14-
dateTime = "0.4.0"
14+
dateTime = "0.6.1"
1515

1616
# Android
1717
hilt = "2.52"
18-
hiltCompose = "1.0.0"
19-
composeBom = "2022.10.00"
18+
hiltCompose = "1.2.0"
19+
composeBom = "2024.11.00"
2020
composeCompiler = "1.5.15"
21-
constraintLayout = "1.0.1"
22-
material = "1.7.0"
23-
splash = "1.0.0"
24-
ktxCore = "1.9.0"
25-
ktxActivity = "1.6.0"
26-
lifecycle = "2.5.1"
27-
navigationCompose = "2.5.3"
28-
coil = "2.2.2"
21+
constraintLayout = "1.1.0"
22+
material = "1.12.0"
23+
splash = "1.0.1"
24+
ktxCore = "1.15.0"
25+
ktxActivity = "1.9.3"
26+
lifecycle = "2.8.7"
27+
navigationCompose = "2.8.4"
28+
coil = "2.7.0"
2929

3030
# Test
31-
junit = "4.13.2"
32-
kotest = "5.5.2"
33-
mockk = "1.13.3"
34-
turbine = "0.12.1"
35-
archTest = "2.1.0"
36-
coroutinesTest = "1.6.4"
31+
kotest = "5.9.1"
32+
mockk = "1.13.13"
33+
turbine = "1.2.0"
34+
archTest = "2.2.0"
3735

3836
[libraries]
3937
# Build
@@ -95,11 +93,10 @@ compose-navigation = { group = "androidx.navigation", name = "navigation-compose
9593
compose-constraintLayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version.ref = "constraintLayout" }
9694

9795
# Test
98-
junit = { group = "junit", name = "junit", version.ref = "junit" }
9996
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
10097
kotest = { group = "io.kotest", name = "kotest-assertions-core", version.ref = "kotest" }
10198
turbine = { group = "app.cash.turbine", name = "turbine", version.ref = "turbine" }
102-
coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutinesTest" }
99+
coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
103100
arch-test = { group = "androidx.arch.core", name = "core-testing", version.ref = "archTest" }
104101

105102
[bundles]

0 commit comments

Comments
 (0)