@@ -21,10 +21,8 @@ class DnsDialogTest {
21
21
DnsDialogViewState (
22
22
input = " " ,
23
23
validationError = null ,
24
- isLocal = false ,
25
24
isAllowLanEnabled = false ,
26
25
index = null ,
27
- isIpv6 = false ,
28
26
isIpv6Enabled = true ,
29
27
)
30
28
@@ -50,7 +48,7 @@ class DnsDialogTest {
50
48
fun testDnsDialogLanWarningShownWhenLanTrafficDisabledAndLocalAddressUsed () =
51
49
composeExtension.use {
52
50
// Arrange
53
- initDialog(defaultState.copy(isAllowLanEnabled = false , isLocal = true ))
51
+ initDialog(defaultState.copy(isAllowLanEnabled = false , input = localIpAddress ))
54
52
55
53
// Assert
56
54
onNodeWithText(LOCAL_DNS_SERVER_WARNING ).assertExists()
@@ -60,7 +58,7 @@ class DnsDialogTest {
60
58
fun testDnsDialogLanWarningNotShownWhenLanTrafficEnabledAndLocalAddressUsed () =
61
59
composeExtension.use {
62
60
// Arrange
63
- initDialog(defaultState.copy(isAllowLanEnabled = true , isLocal = true ))
61
+ initDialog(defaultState.copy(isAllowLanEnabled = true , input = localIpAddress ))
64
62
65
63
// Assert
66
64
onNodeWithText(LOCAL_DNS_SERVER_WARNING ).assertDoesNotExist()
@@ -70,7 +68,7 @@ class DnsDialogTest {
70
68
fun testDnsDialogLanWarningNotShownWhenLanTrafficEnabledAndNonLocalAddressUsed () =
71
69
composeExtension.use {
72
70
// Arrange
73
- initDialog(defaultState.copy(isAllowLanEnabled = true , isLocal = false ))
71
+ initDialog(defaultState.copy(isAllowLanEnabled = true , input = publicIpAddress ))
74
72
75
73
// Assert
76
74
onNodeWithText(LOCAL_DNS_SERVER_WARNING ).assertDoesNotExist()
@@ -80,7 +78,7 @@ class DnsDialogTest {
80
78
fun testDnsDialogLanWarningNotShownWhenLanTrafficDisabledAndNonLocalAddressUsed () =
81
79
composeExtension.use {
82
80
// Arrange
83
- initDialog(defaultState.copy(isAllowLanEnabled = false , isLocal = false ))
81
+ initDialog(defaultState.copy(isAllowLanEnabled = false , input = publicIpAddress ))
84
82
85
83
// Assert
86
84
onNodeWithText(LOCAL_DNS_SERVER_WARNING ).assertDoesNotExist()
@@ -107,7 +105,7 @@ class DnsDialogTest {
107
105
// Arrange
108
106
initDialog(
109
107
defaultState.copy(
110
- input = " 192.168.0.1 " ,
108
+ input = localIpAddress ,
111
109
validationError = ValidationError .DuplicateAddress ,
112
110
)
113
111
)
@@ -122,5 +120,7 @@ class DnsDialogTest {
122
120
" \" Local Network Sharing\" under VPN settings."
123
121
124
122
private const val invalidIpAddress = " 300.300.300.300"
123
+ private const val localIpAddress = " 192.168.0.1"
124
+ private const val publicIpAddress = " 1.1.1.1"
125
125
}
126
126
}
0 commit comments