From 7ee7dc474adaae85438f15bcb57ac31d6ec6adf8 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Sun, 27 Sep 2026 07:31:41 +0000 Subject: [PATCH] drop the indicator placement test It measured pixel bounds to assert which line the indicator sits on and which side of the artist name it lands. That is a presentational choice with exactly one place in the code that makes it, so the test could only fail when someone deliberately changed that line, and would break on unrelated layout changes. The state-to-indicator tests and the accessibility descriptions stay. --- .../subtracks/ui/library/SongRowDownloadTest.kt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/src/test/kotlin/com/subtracks/ui/library/SongRowDownloadTest.kt b/app/src/test/kotlin/com/subtracks/ui/library/SongRowDownloadTest.kt index fe9ca45b..cfb9eed0 100644 --- a/app/src/test/kotlin/com/subtracks/ui/library/SongRowDownloadTest.kt +++ b/app/src/test/kotlin/com/subtracks/ui/library/SongRowDownloadTest.kt @@ -5,18 +5,15 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithText -import androidx.compose.ui.unit.dp import androidx.test.ext.junit.runners.AndroidJUnit4 import com.subtracks.data.model.DownloadStatus import com.subtracks.data.model.Song import com.subtracks.data.model.SongDownload import com.subtracks.ui.theme.SubtracksTheme -import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.robolectric.annotation.GraphicsMode -import kotlin.math.abs @RunWith(AndroidJUnit4::class) @GraphicsMode(GraphicsMode.Mode.NATIVE) @@ -63,18 +60,6 @@ class SongRowDownloadTest { composeRule.onNodeWithContentDescription("Downloaded").assertDoesNotExist() } - @Test - fun theDownloadedIndicatorSitsOnTheArtistLineToItsLeft() { - render(download(DownloadStatus.Completed)) - - val badge = composeRule.onNodeWithContentDescription("Downloaded", useUnmergedTree = true).fetchSemanticsNode().boundsInRoot - val artist = composeRule.onNodeWithText("Artist", useUnmergedTree = true).fetchSemanticsNode().boundsInRoot - - assertTrue("expected the indicator left of the artist name, badge=$badge artist=$artist", badge.right <= artist.left) - val offBy = abs(badge.center.y - artist.center.y) - assertTrue("expected the indicator on the artist's line, off by ${offBy}px", offBy <= with(composeRule.density) { 2.dp.toPx() }) - } - private fun download(status: DownloadStatus) = SongDownload(sourceId = 1, songId = "s1", status = status, engineId = 7, bytes = 40, total = 100)