Internet: Home's card connected, in the screenshots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
This commit is contained in:
Claude committed 2026-10-17 01:41:02 +00:00
1 parent 87df1f4c3f
commit bfb26a2171
2 files changed
+26

No files matched your search

@@ -180,6 +180,11 @@ object Internet {
if (p != null) p.stop("disconnected") else line?.cancel("disconnected")
}
/** (for the screenshots: a link's state shown) */
internal fun show(s: State?) {
_state.value = s
}
fun dismiss() {
if (!running) _state.value = null
}
@@ -61,6 +61,27 @@ class FaxShotsTest {
Fax.show(null)
}
@Test
fun internetOnHome() {
val ctx = ApplicationProvider.getApplicationContext<android.content.Context>()
runBlocking { com.neodesktop.dmodem.settings.IspSettingsStore(ctx).save(com.neodesktop.dmodem.settings.IspSettings("18005551000", "alice", "x")) }
ModemState.setRun(ModemState.Run.RUNNING)
ModemState.setStatus(ModemState.IDLE)
val cfg = com.neodesktop.dmodem.ppp.Ppp.IpConfig(
java.net.InetAddress.getByName("192.0.2.42") as java.net.Inet4Address, null,
listOf(java.net.InetAddress.getByName("192.0.2.1") as java.net.Inet4Address), 1500,
)
com.neodesktop.dmodem.ppp.Internet.show(
com.neodesktop.dmodem.ppp.Internet.State("", cfg, "CONNECT 50666/V92/LAPM/V44", System.currentTimeMillis() - 754_000, 1_843_200, 96_512),
)
compose.mainClock.autoAdvance = false
compose.mainClock.advanceTimeBy(500)
val bmp = compose.onNodeWithText("Connected to the internet").let { compose.onRoot() }.captureToImage().asAndroidBitmap()
File("build/screens").mkdirs()
File("build/screens/internet-1-home.png").outputStream().use { bmp.compress(Bitmap.CompressFormat.PNG, 100, it) }
com.neodesktop.dmodem.ppp.Internet.show(null)
}
@Test
fun faxSettings() {
compose.onNodeWithText("Settings").performClick()