diff --git a/tests/unit/test_card.py b/tests/unit/test_card.py index 7862038..f6ea3ac 100644 --- a/tests/unit/test_card.py +++ b/tests/unit/test_card.py @@ -66,6 +66,22 @@ def test_badge_svg_differentiates_intentional_vs_unintentional_skip(): assert "expected" not in gap +def test_skip_rows_intentional_and_unintentional(): + html_out = C._skip_rows( + {"intentional": {"backup_restore": "no persistent data"}, "unintentional": ["functional"]} + ) + # intentional skip: labelled row (muted green) + the reason on its own line + assert "intentional skip" in html_out and C.SKIP_GREEN in html_out + assert "backup/restore" in html_out and "no persistent data" in html_out + # unintentional skip: amber row + prompt to declare/add coverage + assert "unintentional skip" in html_out and C.GAP_COLOR in html_out + assert "functional" in html_out and "EXPECTED_NA" in html_out + + +def test_skip_rows_empty_when_no_skips(): + assert C._skip_rows({"intentional": {}, "unintentional": []}) == "" + + def test_card_html_reports_level_verbatim(): html = C.render_card_html(_data(level=2, cap="L3 backup/restore (data integrity) N/A")) assert "uptime-kuma" in html