mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-27 06:29:54 +00:00
Fix story splitting in multishare flow.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package org.thoughtcrime.securesms.sharing
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class DistributionListMultiShareTimestampProviderTest {
|
||||
|
||||
@Test
|
||||
fun `When I ask for index 4, then I expect to fill 4 new items`() {
|
||||
val generator = mutableListOf(1L, 2, 3, 4, 5).map { it.seconds }.toMutableList()
|
||||
val testSubject = DistributionListMultiShareTimestampProvider(getCurrentTimeMillis = { generator.removeAt(0) }, sleepTimeout = 0.seconds)
|
||||
|
||||
val actual = testSubject.getMillis(4).milliseconds
|
||||
assertEquals(5.seconds, actual)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user