diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-11-14 07:25:36 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-11-14 07:25:36 +0000 |
| commit | d4738ee16513b86d9e66480ea10b0b19a7f9809c (patch) | |
| tree | aa66d45eac68618d8fbc6132f0946d36fd1f53fa /app/src/androidTest | |
| parent | 8e70e36563e1b32280b1391bbd390e164bd13b52 (diff) | |
Two of Peter's, both on surfaces that already had the pieces.
Holding a show in the library plays what it is offering, the same gesture the
episode list has carried since the row buttons changed. Playing a show's newest
episode meant opening the show first, which is two taps for the thing you want
most often. A show offering nothing does nothing when held, rather than
something arbitrary -- tapping still opens it either way.
The transport's second row reads sleep, speed, ad. It was the reverse, which
was my ordering and not a considered one. Sleep is set deliberately before
settling down so it takes the near edge; the ad button is hit mid-listen when
something slips through, so it sits furthest out where a stray press costs the
least.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
Diffstat (limited to 'app/src/androidTest')
| -rw-r--r-- | app/src/androidTest/java/org/terst/listen/ui/LibraryRowTest.kt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/app/src/androidTest/java/org/terst/listen/ui/LibraryRowTest.kt b/app/src/androidTest/java/org/terst/listen/ui/LibraryRowTest.kt index a66337f..af45221 100644 --- a/app/src/androidTest/java/org/terst/listen/ui/LibraryRowTest.kt +++ b/app/src/androidTest/java/org/terst/listen/ui/LibraryRowTest.kt @@ -4,7 +4,9 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.longClick import androidx.compose.ui.test.performClick +import androidx.compose.ui.test.performTouchInput import androidx.test.ext.junit.runners.AndroidJUnit4 import org.junit.Assert.assertEquals import org.junit.Rule @@ -108,6 +110,46 @@ class LibraryRowTest { } /** + * Press and hold a show to play what it is offering. + * + * The same gesture the episode list already had, and for the same reason: the row's three + * buttons are the deliberate ones, and "just play it" wants no width at all. Without this, + * playing the newest episode of a show from the library meant opening the show first. + */ + @Test + fun holdingAShowPlaysTheEpisodeItOffers() { + var played = 0 + compose.setContent { + SubscriptionRow( + listing = SubscriptionListing(show("s", "Zebra Hour"), waiting = 1), + latest = episode("e", "s", "The one about stripes"), + actions = noActions().copy(play = { played++ }), + ) {} + } + + compose.onNodeWithText("The one about stripes").performTouchInput { longClick() } + + assertEquals(1, played) + } + + /** A tap still opens the show, so holding has not replaced the ordinary gesture. */ + @Test + fun tappingAShowStillOpensIt() { + var opened = 0 + compose.setContent { + SubscriptionRow( + listing = SubscriptionListing(show("s", "Zebra Hour"), waiting = 1), + latest = episode("e", "s", "The one about stripes"), + actions = noActions(), + ) { opened++ } + } + + compose.onNodeWithText("Zebra Hour").performClick() + + assertEquals(1, opened) + } + + /** * Marking it played is the control that was missing, and the reason the row changed: saying * "not now" without opening the show is what sends a long library back to being scrollable. */ |
