mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
address the review of the tap targets
The "stays inert" test was tautological: the render helper always passed non-null no-op
lambdas, so its assertion held for any implementation. It now passes nullable callbacks
and asserts the targets are disabled, which fails if the gate is removed.
Accessibility: both taps carry onClickLabel ("Open album"/"Open artist") and the artist
box spans the full row, and the now playing cover passes showPlaceholder = coverArt ==
null so the always-present placeholder letter is not merged into the tap target's label
(the same flash the artist detail cells had).
Left as-is: the artist target is still one line tall (~20dp), and the album detail
subtitle tap covers the year too. Both are layout/scope trade-offs.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.subtracks.ui.playback
|
||||
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.compose.ui.test.assertIsNotEnabled
|
||||
import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithTag
|
||||
import androidx.compose.ui.test.onNodeWithText
|
||||
@@ -11,7 +12,6 @@ import com.subtracks.playback.PlaybackState
|
||||
import com.subtracks.playback.QueueItem
|
||||
import com.subtracks.ui.theme.SubtracksTheme
|
||||
import com.subtracks.ui.theme.artworkColorsFromSeed
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@@ -41,8 +41,8 @@ class NowPlayingTapsTest {
|
||||
)
|
||||
|
||||
private fun render(
|
||||
onAlbumClick: () -> Unit = {},
|
||||
onArtistClick: () -> Unit = {},
|
||||
onAlbumClick: (() -> Unit)? = null,
|
||||
onArtistClick: (() -> Unit)? = null,
|
||||
) {
|
||||
composeRule.setContent {
|
||||
SubtracksTheme {
|
||||
@@ -87,12 +87,9 @@ class NowPlayingTapsTest {
|
||||
|
||||
@Test
|
||||
fun theTapTargetsStayInertWithoutADestination() {
|
||||
var opened = false
|
||||
render()
|
||||
|
||||
composeRule.onNodeWithTag(NOW_PLAYING_COVER_TAG).performClick()
|
||||
composeRule.onNodeWithText("Radiohead").performClick()
|
||||
|
||||
assertFalse(opened)
|
||||
composeRule.onNodeWithTag(NOW_PLAYING_COVER_TAG).assertIsNotEnabled()
|
||||
composeRule.onNodeWithText("Radiohead").assertIsNotEnabled()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user