First launch for a new user, on Emby (from 0.108.35)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package tv.orbit.classic
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class OnboardingTest {
|
||||
@Test fun theStepsRunInTheDesignedOrder() {
|
||||
assertEquals(listOf("Welcome", "Server", "Sign in", "Channels", "Who watches", "All set"), OnboardStep.entries.map { it.label })
|
||||
}
|
||||
|
||||
@Test fun theStartingChannelsAreRealAndNeverAfterDark() {
|
||||
val numbers = SmartChannels.map { it.number }.toSet()
|
||||
assertTrue(OnboardStartChannels.all { it in numbers })
|
||||
assertTrue(OnboardStartChannels.none { it in LockedChannels })
|
||||
}
|
||||
|
||||
@Test fun theTimeLeftComesFromHowLongTheChannelsSoFarTook() {
|
||||
ChannelSetup.begin(listOf(101, 106, 201, 107))
|
||||
val start = ChannelSetup.startedAt
|
||||
// Before any are done, a minute each.
|
||||
assertEquals(4, ChannelSetup.minutesLeft(start))
|
||||
// Two done in four minutes: two left at two minutes each.
|
||||
ChannelSetup.found = mapOf(101 to 180, 106 to 90)
|
||||
assertEquals(4, ChannelSetup.minutesLeft(start + 4 * 60_000))
|
||||
assertFalse(ChannelSetup.finished)
|
||||
ChannelSetup.found = ChannelSetup.found + mapOf(201 to 40, 107 to -1)
|
||||
assertTrue(ChannelSetup.finished); assertEquals(0, ChannelSetup.minutesLeft(start + 9 * 60_000))
|
||||
ChannelSetup.begin(emptyList())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user