Files
honeyDueKMP/composeApp/src/commonTest/kotlin/com/tt/honeyDue/viewmodel/TaskViewModelTest.kt
Trey T 334767cee7 Production hardening: password complexity, token refresh, network resilience
Password complexity: real-time validation UI on register, onboarding, and reset screens
  (uppercase, lowercase, digit, min 8 chars) — Compose + iOS Swift
iOS privacy descriptions: camera, photo library, photo save usage strings
Token refresh: Ktor interceptor catches 401 "token_expired", refreshes, retries
Retry with backoff: 3 retries on 5xx/IO errors, exponential delay (1s base, 10s max)
Gzip: ContentEncoding plugin on all platform HTTP clients
Request timeouts: 30s request, 10s connect, 30s socket
Validation rules: split passwordMissingLetter into uppercase/lowercase (iOS Swift)
Test fixes: corrected import paths in 5 existing test files
New tests: HTTP client retry/refresh (9), validation rules
2026-03-26 14:05:33 -05:00

39 lines
847 B
Kotlin

package com.tt.honeyDue.viewmodel
import com.tt.honeyDue.viewmodel.TaskViewModel
import com.tt.honeyDue.network.ApiResult
import kotlin.test.Test
import kotlin.test.assertIs
class TaskViewModelTest {
// MARK: - Initialization Tests
@Test
fun testInitialTasksState() {
// Given
val viewModel = TaskViewModel()
// Then
assertIs<ApiResult.Idle>(viewModel.tasksState.value)
}
@Test
fun testInitialTasksByResidenceState() {
// Given
val viewModel = TaskViewModel()
// Then
assertIs<ApiResult.Idle>(viewModel.tasksByResidenceState.value)
}
@Test
fun testInitialAddNewCustomTaskState() {
// Given
val viewModel = TaskViewModel()
// Then
assertIs<ApiResult.Idle>(viewModel.taskAddNewCustomTaskState.value)
}
}