mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-22 07:18:26 +00:00
fix: disappearing viewmodel tests (#1432)
This commit is contained in:
parent
7bcf823740
commit
3dee7ec6bd
@ -53,6 +53,7 @@ class DisappearingMessagesViewModelTest {
|
|||||||
@Mock lateinit var application: Application
|
@Mock lateinit var application: Application
|
||||||
@Mock lateinit var textSecurePreferences: TextSecurePreferences
|
@Mock lateinit var textSecurePreferences: TextSecurePreferences
|
||||||
@Mock lateinit var messageExpirationManager: SSKEnvironment.MessageExpirationManagerProtocol
|
@Mock lateinit var messageExpirationManager: SSKEnvironment.MessageExpirationManagerProtocol
|
||||||
|
@Mock lateinit var disappearingMessages: DisappearingMessages
|
||||||
@Mock lateinit var threadDb: ThreadDatabase
|
@Mock lateinit var threadDb: ThreadDatabase
|
||||||
@Mock lateinit var groupDb: GroupDatabase
|
@Mock lateinit var groupDb: GroupDatabase
|
||||||
@Mock lateinit var storage: Storage
|
@Mock lateinit var storage: Storage
|
||||||
@ -114,9 +115,9 @@ class DisappearingMessagesViewModelTest {
|
|||||||
isSelfAdmin = true,
|
isSelfAdmin = true,
|
||||||
address = LOCAL_ADDRESS,
|
address = LOCAL_ADDRESS,
|
||||||
isNoteToSelf = true,
|
isNoteToSelf = true,
|
||||||
expiryMode = ExpiryMode.NONE,
|
expiryMode = ExpiryMode.Legacy(0),
|
||||||
isNewConfigEnabled = false,
|
isNewConfigEnabled = false,
|
||||||
persistedMode = ExpiryMode.NONE,
|
persistedMode = ExpiryMode.Legacy(0),
|
||||||
showDebugOptions = false
|
showDebugOptions = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -127,7 +128,7 @@ class DisappearingMessagesViewModelTest {
|
|||||||
UiState(
|
UiState(
|
||||||
OptionsCard(
|
OptionsCard(
|
||||||
R.string.activity_disappearing_messages_timer,
|
R.string.activity_disappearing_messages_timer,
|
||||||
typeOption(ExpiryMode.NONE, selected = true),
|
typeOption(ExpiryMode.NONE, selected = false),
|
||||||
timeOption(ExpiryType.LEGACY, 12.hours),
|
timeOption(ExpiryType.LEGACY, 12.hours),
|
||||||
timeOption(ExpiryType.LEGACY, 1.days),
|
timeOption(ExpiryType.LEGACY, 1.days),
|
||||||
timeOption(ExpiryType.LEGACY, 7.days),
|
timeOption(ExpiryType.LEGACY, 7.days),
|
||||||
@ -555,6 +556,7 @@ class DisappearingMessagesViewModelTest {
|
|||||||
application,
|
application,
|
||||||
textSecurePreferences,
|
textSecurePreferences,
|
||||||
messageExpirationManager,
|
messageExpirationManager,
|
||||||
|
disappearingMessages,
|
||||||
threadDb,
|
threadDb,
|
||||||
groupDb,
|
groupDb,
|
||||||
storage,
|
storage,
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package org.session.libsession.messaging.messages
|
package org.session.libsession.messaging.messages
|
||||||
|
|
||||||
import network.loki.messenger.libsession_util.util.ExpiryMode
|
import network.loki.messenger.libsession_util.util.ExpiryMode
|
||||||
import org.session.libsession.snode.SnodeAPI
|
|
||||||
|
|
||||||
data class ExpirationConfiguration(
|
data class ExpirationConfiguration(
|
||||||
val threadId: Long = -1,
|
val threadId: Long = -1,
|
||||||
@ -11,7 +10,7 @@ data class ExpirationConfiguration(
|
|||||||
val isEnabled = expiryMode.expirySeconds > 0
|
val isEnabled = expiryMode.expirySeconds > 0
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val isNewConfigEnabled = SnodeAPI.nowWithOffset >= 1710284400000
|
val isNewConfigEnabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user