package com.cottondb.storyimport android.app.Applicationimport androidx.compose.foundation.layout.Rowimport androidx.compose.foundation.layout.sizeimport androidx.compose.foundation.layout.widthimport androidx.compose.runtime.CompositionLocalProviderimport androidx.compose.ui.Modifierimport androidx.compose.ui.platform.LocalDensityimport androidx.compose.ui.test.getBoundsInRootimport androidx.compose.ui.test.junit4.createComposeRuleimport androidx.compose.ui.test.onNodeWithTagimport androidx.compose.ui.unit.Densityimport androidx.compose.ui.unit.dpimport com.cottondb.story.ink.BarChipsimport com.cottondb.story.ink.Chipimport org.junit.Assert.assertTrueimport org.junit.Ruleimport org.junit.Testimport org.junit.runner.RunWithimport org.robolectric.RobolectricTestRunnerimport org.robolectric.annotation.Config/** * At the phone's largest text (font scale 2) the writing bar's chips stay whole: Note was squeezed to a column of single * letters standing over the mic (the emulator, 21 Nov 2026). Here the bar's chips in the room a 400 dp phone leaves them. */@RunWith(RobolectricTestRunner::class)@Config(sdk = [35], qualifiers = "w400dp-h700dp-mdpi", application = Application::class)classStoryLargeTextTest { @get:Ruleval compose = createComposeRule() @Test fun the_bar_chips_stay_whole_at_the_largest_text() { compose.setContent {val density = LocalDensity.currentCompositionLocalProvider(LocalDensity provides Density(density.density, fontScale = 2f)) {Row(Modifier.width(400.dp)) {BarChips(Modifier.weight(1f)) {Chip("Caspian", "speaker", on = true, caret = true) {}Chip("Action", "action", on = false) {}Chip("Note", "note", on = false) {} } androidx.compose.foundation.layout.Box(Modifier.size(34.dp)) androidx.compose.foundation.layout.Box(Modifier.size(34.dp)) } } }val chips = listOf("speaker", "action", "note").map { compose.onNodeWithTag(it).getBoundsInRoot() }val note = chips[2]val action = chips[1]// Whole: as tall as Action (one line of words), not a column of letters. assertTrue("Note squeezed: $note against $action", note.bottom - note.top <= action.bottom - action.top + 1.dp)// No two chips overlap.for (i in chips.indices) for (j in i + 1 until chips.size) {val a = chips[i]; val b = chips[j]val apart = a.right <= b.left || b.right <= a.left || a.bottom <= b.top || b.bottom <= a.top assertTrue("chips $i and $j overlap: $a $b", apart) }// And none reaches over the mic and Send at the row's end. assertTrue(chips.all { it.right <= 332.dp }) }}