From 21fcdf485cc707c33fad171e7be935c006334423 Mon Sep 17 00:00:00 2001 From: hermes Date: Mon, 9 Nov 2026 20:57:19 +1000 Subject: [PATCH] test: the advice in the table is a pop-out, not the text --- tests/test_brew_advice.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_brew_advice.py b/tests/test_brew_advice.py index d45b790..8fc5e98 100644 --- a/tests/test_brew_advice.py +++ b/tests/test_brew_advice.py @@ -995,6 +995,35 @@ def test_the_advice_is_shown_on_the_active_beers_page(client, repo): assert "Brewing advice" in body +def test_the_advice_in_the_table_is_a_popout_not_the_text(client, repo): + """The advice in the table is a trigger, and the text is in a panel. + + The advice is several hundred characters. In a table cell it made + the table wider than a phone, so the column was clipped off the + right edge and the advice could not be read. + """ + repo.users.insert_one({"username": "beer", "password": "beer_pass"}) + client.post("/login", data={"username": "beer", "password": "beer_pass"}, + follow_redirects=True) + + seed_readings(repo, [("1", "Ale", "1042", "2026-01-01", False, "")]) + doc = repo.readings.find_one({"beer_run_id": "1"}) + repo.set_reading_advice(str(doc["_id"]), "Warm it to 21C and wait.", ok=True) + + body = client.get("/brews").get_data(as_text=True) + + # The trigger is a real button, so it works with a keyboard. + assert "advice-trigger" in body + assert 'class="advice-trigger' in body + + # The text lives in the panel, not in the cell. + assert "advice-pop" in body + assert "advice-pop__text" in body + + # The full advice is in the page - it is just not in the cell. + assert "Warm it to 21C and wait." in body + + def test_a_failed_advice_is_marked_as_such(client, repo): """A generation failure reads differently from real advice.""" repo.users.insert_one({"username": "beer", "password": "beer_pass"})