mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
test: wait for the repository's active source in artist art tests
awaitActiveSourceId() watched the DAO's activeSourceId flow, which turns non-null as soon as the source row is written. SourceRepository sets its in-memory active source in a separate collector, so artistImage() could still see null and the online URL assertion failed. Wait on the repository's own activeSource readiness signal instead.
This commit is contained in:
@@ -314,7 +314,7 @@ class SourceRepositoryTest {
|
||||
assertNull(repository.artistImage("ar2", "https://img.example/ar2.jpg"))
|
||||
}
|
||||
|
||||
private suspend fun awaitActiveSourceId(): Long = withTimeout(TEST_TIMEOUT_MS) { repository.activeSourceId().first { it != null }!! }
|
||||
private suspend fun awaitActiveSourceId(): Long = withTimeout(TEST_TIMEOUT_MS) { repository.activeSource.first { it != null }!! }
|
||||
|
||||
private suspend fun awaitCoverArt(coverArt: String): CoverArtRef =
|
||||
withTimeout(TEST_TIMEOUT_MS) {
|
||||
|
||||
Reference in New Issue
Block a user