mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
Tests: the SIP line's new menu label; anonymous SIP's settings and SIP addresses
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRSJKSd2kxxKFZAiaXQ
This commit is contained in:
2 files changed
+25
-3
No files matched your search
@@ -30,6 +30,28 @@ class ModemSettingsTest {
|
||||
assertTrue(ModemSettings(user = "u", domain = "h").complete)
|
||||
}
|
||||
|
||||
/** anonymous SIP: complete with no account, the engine given none (the account kept), said so */
|
||||
@Test
|
||||
fun anonymousSipNeedsNoAccount() {
|
||||
val s = ModemSettings(anonymous = true)
|
||||
assertTrue(s.complete)
|
||||
assertTrue(s.sip)
|
||||
assertEquals(Triple("", "", ""), s.sipAccount)
|
||||
val kept = ModemSettings(user = "u", password = "p", domain = "h", anonymous = true)
|
||||
assertEquals(Triple("", "", ""), kept.sipAccount)
|
||||
assertEquals(Triple("u", "p", "h"), kept.copy(anonymous = false).sipAccount)
|
||||
assertTrue(s.sipSummary.startsWith("anonymous"))
|
||||
assertEquals("u@h", kept.copy(anonymous = false).sipSummary)
|
||||
}
|
||||
|
||||
/** a SIP address as D-Modem dials it: sip: before it when it has no scheme */
|
||||
@Test
|
||||
fun sipAddressesGetTheirScheme() {
|
||||
assertEquals("sip:bbs@example.com", org.dmodem.app.android.ui.sipAddress(" bbs@example.com "))
|
||||
assertEquals("sip:bbs@example.com", org.dmodem.app.android.ui.sipAddress("sip:bbs@example.com"))
|
||||
assertEquals("SIPS:bbs@example.com", org.dmodem.app.android.ui.sipAddress("SIPS:bbs@example.com"))
|
||||
}
|
||||
|
||||
/** a USB modem needs no SIP account and is no peer line; the other lines as they were */
|
||||
@Test
|
||||
fun aUsbModemNeedsNoAccountAndIsNoPeer() {
|
||||
|
||||
@@ -64,7 +64,7 @@ class PeerShotsTest {
|
||||
save(ModemSettings(line = ModemSettings.LINE_SIP))
|
||||
SettingsNav.open(SettingsPage.LINE)
|
||||
compose.onNodeWithText("Settings").performClick()
|
||||
compose.onNodeWithText("A SIP account (calls over the internet)").performScrollTo().performClick()
|
||||
compose.onNodeWithText("SIP: an account, or anonymous (calls over the internet)").performScrollTo().performClick()
|
||||
compose.onNodeWithText("Another phone with D-Modem, on Wi-Fi").performClick()
|
||||
compose.onNodeWithText("Find phones on this network").performScrollTo().assertExists()
|
||||
shot("peer-0-line-menu")
|
||||
@@ -78,7 +78,7 @@ class PeerShotsTest {
|
||||
compose.onNodeWithText("Settings").performClick()
|
||||
// (under More: the Wi-Fi / Cell lines' menu hasn't it)
|
||||
compose.onNodeWithText("More").performClick()
|
||||
compose.onNodeWithText("A SIP account (calls over the internet)").performScrollTo().performClick()
|
||||
compose.onNodeWithText("SIP: an account, or anonymous (calls over the internet)").performScrollTo().performClick()
|
||||
compose.onNodeWithText("No line (the modem on its own)").performClick()
|
||||
compose.onNodeWithText("a dial gets NO DIALTONE", substring = true).assertExists()
|
||||
// (no SIP account asked for)
|
||||
@@ -92,7 +92,7 @@ class PeerShotsTest {
|
||||
save(ModemSettings(line = ModemSettings.LINE_SIP))
|
||||
SettingsNav.open(SettingsPage.LINE)
|
||||
compose.onNodeWithText("Settings").performClick()
|
||||
compose.onNodeWithText("A SIP account (calls over the internet)").performScrollTo().performClick()
|
||||
compose.onNodeWithText("SIP: an account, or anonymous (calls over the internet)").performScrollTo().performClick()
|
||||
compose.onNodeWithText("Another phone with D-Modem, on Wi-Fi").assertExists()
|
||||
compose.onNodeWithText("No line (the modem on its own)").assertDoesNotExist()
|
||||
compose.onNodeWithText("A phone line, through a USB modem").assertDoesNotExist()
|
||||
|
||||
Reference in new issue
Block a user