You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/src/test/kotlin/io/homeassistant/companion/android/onboarding/manualserver/ManualServerViewModelTest.kt
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,26 @@ class ManualServerViewModelTest {
63
63
}
64
64
}
65
65
66
+
@Test
67
+
fun`Given url with malformed port when onServerUrlChange then isServerUrlValid is false`() = runTest {
68
+
val malformedUrl ="http://homeassistant.local::8123"
69
+
70
+
turbineScope {
71
+
val serverUrlFlow = viewModel.serverUrlFlow.testIn(backgroundScope)
72
+
val isServerUrlValidFlow = viewModel.isServerUrlValidFlow.testIn(backgroundScope)
73
+
assertEquals("", serverUrlFlow.awaitItem())
74
+
assertFalse(isServerUrlValidFlow.awaitItem())
75
+
76
+
// URLUtil may return true but java.net.URL parsing should fail
0 commit comments