feat(stage): show Bandcamp link in ON AIR
This commit is contained in:
1 parent
8e1c0a64eb
commit
66729c7542
4 files changed
+81
-3
No files matched your search
@@ -133,3 +133,27 @@ async def test_narrow_layout() -> None:
|
||||
text = rendered_text(app)
|
||||
assert "STATIONS" in text
|
||||
assert "ON AIR" in text
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_stage_shows_bandcamp_link_only_when_present() -> None:
|
||||
app = SomaFMApp(autoplay=False, offline=True, audio=False)
|
||||
async with app.run_test(size=(110, 40)) as pilot:
|
||||
await pilot.pause()
|
||||
station = app.current
|
||||
assert station is not None
|
||||
song = Song(
|
||||
title="Rauschebart",
|
||||
artist="Jens Buchert",
|
||||
album="Gravity",
|
||||
bandcamp_url="https://jensbuchert.bandcamp.com/track/rauschebart",
|
||||
)
|
||||
station.now_playing = song
|
||||
app.query_one(StagePanel).refresh_stage()
|
||||
await pilot.pause()
|
||||
assert "Bandcamp" in rendered_text(app)
|
||||
|
||||
song.bandcamp_url = ""
|
||||
app.query_one(StagePanel).refresh_stage()
|
||||
await pilot.pause()
|
||||
assert "Bandcamp" not in rendered_text(app)
|
||||
Reference in new issue
Block a user