Fix story splitting in multishare flow.

This commit is contained in:
Alex Hart
2023-01-06 15:19:11 -04:00
parent bdbeefe08e
commit af0fbdd2b2
4 changed files with 98 additions and 9 deletions

View File

@@ -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)
}
}