open now playing when the media notification is tapped

This commit is contained in:
austinried
2026-10-04 00:30:07 +00:00
parent 6eb23445f1
commit 46ab8f66c4
4 changed files with 70 additions and 5 deletions
@@ -0,0 +1,33 @@
package com.subtracks.ui
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class NowPlayingRequestTest {
@Test
fun aNotificationWithNothingPlayingDoesNotOpen() {
assertFalse(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = false))
}
@Test
fun aNotificationWithSomethingPlayingOpens() {
assertTrue(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = true))
}
@Test
fun anAlreadyHandledRequestDoesNotReopen() {
assertFalse(shouldOpenNowPlaying(request = 1, handled = 1, playerVisible = true))
}
@Test
fun aNewerRequestOpensAgain() {
assertTrue(shouldOpenNowPlaying(request = 2, handled = 1, playerVisible = true))
}
@Test
fun anOldRequestWaitsUntilSomethingIsPlaying() {
assertFalse(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = false))
assertTrue(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = true))
}
}