Use "imap" prefix for "useCompression" properties

This commit is contained in:
cketti 2023-06-28 14:30:16 +02:00
parent 428b586c88
commit e43ea29378
7 changed files with 13 additions and 13 deletions

View file

@ -191,9 +191,9 @@ internal fun AccountIncomingConfigContent(
item {
CheckboxInput(
text = stringResource(id = R.string.account_setup_incoming_config_compression_label),
checked = state.useCompression,
onCheckedChange = { onEvent(Event.UseCompressionChanged(it)) },
text = stringResource(id = R.string.account_setup_incoming_config_imap_compression_label),
checked = state.imapUseCompression,
onCheckedChange = { onEvent(Event.ImapUseCompressionChanged(it)) },
contentPadding = defaultItemPadding(),
)
}

View file

@ -28,7 +28,7 @@ interface AccountIncomingConfigContract {
val clientCertificate: String = "",
val imapAutodetectNamespaceEnabled: Boolean = true,
val imapPrefix: StringInputField = StringInputField(),
val useCompression: Boolean = true,
val imapUseCompression: Boolean = true,
val isSuccess: Boolean = false,
val error: Error? = null,
@ -45,7 +45,7 @@ interface AccountIncomingConfigContract {
data class ClientCertificateChanged(val clientCertificate: String) : Event()
data class ImapAutoDetectNamespaceChanged(val enabled: Boolean) : Event()
data class ImapPrefixChanged(val imapPrefix: String) : Event()
data class UseCompressionChanged(val useCompression: Boolean) : Event()
data class ImapUseCompressionChanged(val useCompression: Boolean) : Event()
object OnNextClicked : Event()
object OnBackClicked : Event()

View file

@ -49,7 +49,7 @@ internal class AccountIncomingConfigViewModel(
it.copy(imapPrefix = it.imapPrefix.updateValue(event.imapPrefix))
}
is Event.UseCompressionChanged -> updateState { it.copy(useCompression = event.useCompression) }
is Event.ImapUseCompressionChanged -> updateState { it.copy(imapUseCompression = event.useCompression) }
Event.OnNextClicked -> onNext()
Event.OnBackClicked -> onBack()

View file

@ -45,7 +45,7 @@
<string name="account_setup_incoming_config_security_label">Security</string>
<string name="account_setup_incoming_config_imap_namespace_label">Auto-detect IMAP namespace</string>
<string name="account_setup_incoming_config_imap_prefix_label">IMAP path prefix</string>
<string name="account_setup_incoming_config_compression_label">Use compression</string>
<string name="account_setup_incoming_config_imap_compression_label">Use compression</string>
<string name="account_setup_incoming_config_loading_message">Checking incoming server settings…</string>
<string name="account_setup_incoming_config_loading_error">Checking incoming server settings failed!</string>
<string name="account_setup_incoming_config_success">Incoming server settings are valid!</string>

View file

@ -26,7 +26,7 @@ class AccountIncomingConfigStateMapperKtTest {
clientCertificate = "",
imapAutodetectNamespaceEnabled = true,
imapPrefix = StringInputField(value = "prefix"),
useCompression = true,
imapUseCompression = true,
)
val result = incomingState.toServerSettings()

View file

@ -26,7 +26,7 @@ class AccountIncomingConfigStateTest {
password = StringInputField(),
clientCertificate = "",
imapAutodetectNamespaceEnabled = true,
useCompression = true,
imapUseCompression = true,
),
)
}

View file

@ -152,12 +152,12 @@ class AccountIncomingConfigViewModelTest {
}
@Test
fun `should change state when UseCompressionChanged event is received`() = runTest {
fun `should change state when ImapUseCompressionChanged event is received`() = runTest {
eventStateTest(
viewModel = testSubject,
initialState = State(useCompression = true),
event = Event.UseCompressionChanged(false),
expectedState = State(useCompression = false),
initialState = State(imapUseCompression = true),
event = Event.ImapUseCompressionChanged(false),
expectedState = State(imapUseCompression = false),
coroutineScope = backgroundScope,
)
}