Skip to content

Commit 53ae61f

Browse files
committed
test: pin '(JSON change)' placeholder copy on JsonBlob preview rows
Locks down the user-visible copy that replaced the misleading 'tap to view' affordance (commit 46bac61). The row's tap action toggles exclusion — there is no viewer — so the placeholder must not promise a tap-to-view interaction. Adds positive assertion that '(JSON change)' is rendered for a PrefValue.JsonBlob change, plus a negative assertion that the legacy 'tap to view' string is absent. — opus 4.7
1 parent 1480311 commit 53ae61f

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/androidTest/kotlin/tribixbite/cleverkeys/SettingsImportPreviewDialogComposeTest.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,36 @@ class SettingsImportPreviewDialogComposeTest {
141141
.assertIsDisplayed()
142142
}
143143

144+
@Test
145+
fun jsonBlobChange_rendersJsonChangePlaceholder() {
146+
// Locks down the new "(JSON change)" copy that replaced the misleading
147+
// "tap to view" affordance (commit 46bac61f3). The row's tap action
148+
// toggles exclusion — there is no viewer — so the copy must not promise
149+
// a tap-to-view interaction.
150+
composeRule.setContent {
151+
MaterialTheme {
152+
Surface {
153+
SettingsImportPreviewDialog(
154+
plan = planWith(
155+
SettingsChange(
156+
key = "layouts",
157+
current = PrefValue.JsonBlob("[]"),
158+
proposed = PrefValue.JsonBlob("[\"qwerty\"]"),
159+
type = ChangeType.MODIFIED,
160+
)
161+
),
162+
onCancel = {},
163+
onApply = { _, _ -> },
164+
)
165+
}
166+
}
167+
}
168+
169+
composeRule.onNodeWithText("(JSON change)", substring = true).assertIsDisplayed()
170+
// Negative assertion: the misleading legacy copy must not be present.
171+
composeRule.onNodeWithText("tap to view", substring = true).assertDoesNotExist()
172+
}
173+
144174
@Test
145175
fun applyButton_alwaysEnabledEvenAtZeroSelection() {
146176
composeRule.setContent {

0 commit comments

Comments
 (0)