Ports iOS HoneyDueUITests AccessibilityIdentifiers + PageObjects pattern to Android Compose UI Test. Kotlin AccessibilityIds object mirrors Swift verbatim so scripts/verify_test_tag_parity.sh can gate on divergence. AAA_SeedTests bracketed first alphanumerically; SuiteZZ cleanup to follow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
Kotlin
52 lines
1.5 KiB
Kotlin
package com.tt.honeyDue.fixtures
|
|
|
|
import com.tt.honeyDue.models.TaskCreateRequest
|
|
import kotlin.random.Random
|
|
|
|
/**
|
|
* Test task fixture mirroring `TestFixtures.TestTask` in Swift.
|
|
*
|
|
* The Go API requires a residenceId and assigns category/priority IDs from
|
|
* DataManager lookups — callers pass the ID of a seeded test residence plus
|
|
* optional lookup IDs after a prefetch.
|
|
*/
|
|
data class TestTask(
|
|
val title: String,
|
|
val description: String,
|
|
val residenceId: Int,
|
|
val priorityId: Int? = null,
|
|
val categoryId: Int? = null,
|
|
val estimatedCost: Double? = null,
|
|
) {
|
|
fun toCreateRequest(): TaskCreateRequest = TaskCreateRequest(
|
|
residenceId = residenceId,
|
|
title = title,
|
|
description = description,
|
|
categoryId = categoryId,
|
|
priorityId = priorityId,
|
|
estimatedCost = estimatedCost,
|
|
)
|
|
|
|
companion object {
|
|
fun basic(residenceId: Int, suffix: String = randomSuffix()): TestTask = TestTask(
|
|
title = "Test Task $suffix",
|
|
description = "A test task",
|
|
residenceId = residenceId,
|
|
)
|
|
|
|
fun urgent(
|
|
residenceId: Int,
|
|
priorityId: Int? = null,
|
|
suffix: String = randomSuffix(),
|
|
): TestTask = TestTask(
|
|
title = "Urgent Task $suffix",
|
|
description = "An urgent task",
|
|
residenceId = residenceId,
|
|
priorityId = priorityId,
|
|
)
|
|
|
|
private fun randomSuffix(): String =
|
|
Random.nextInt(1000, 9999).toString()
|
|
}
|
|
}
|