feat(#76): add testTag identifiers to composable elements for UI test targeting (#98)

Adds testTag modifiers to key interactive elements across the core
composables, enabling Espresso/Compose UI tests to locate them:

Navigation.kt  — 'nav_*' on bottom bar items, 'drawer_*' on drawer items
HermesScaffold — 'back_button', 'menu_button', 'refresh_button'
StateViews.kt  — 'loading_state', 'loading_spinner', 'error_retry_button',
                 'empty_state_action'
ChatScreen.kt  — 'chat_input', 'send_button', 'interrupt_button'

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-06-19 22:15:53 +03:00
1 parent cc52442be3
commit abcec14cb5
4 files changed
+38 -8

No files matched your search

@@ -84,6 +84,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp
@@ -650,7 +651,8 @@ private fun ChatInputBar(
modifier =
Modifier
.weight(1f)
.heightIn(max = 140.dp),
.heightIn(max = 140.dp)
.testTag("chat_input"),
placeholder = {
Text(
if (!isConnected) {
@@ -679,7 +681,10 @@ private fun ChatInputBar(
// Interrupt button
FilledTonalButton(
onClick = onInterrupt,
modifier = Modifier.size(48.dp),
modifier =
Modifier
.size(48.dp)
.testTag("interrupt_button"),
shape = CircleShape,
contentPadding = PaddingValues(0.dp),
) {
@@ -694,7 +699,10 @@ private fun ChatInputBar(
FilledTonalButton(
onClick = onSend,
enabled = canSend,
modifier = Modifier.size(48.dp),
modifier =
Modifier
.size(48.dp)
.testTag("send_button"),
shape = CircleShape,
contentPadding = PaddingValues(0.dp),
) {