from juris_base.utils.html import strip_html, clean_whitespace


def test_strip_html_removes_tags():
    assert strip_html("<p>Hello <b>world</b></p>") == "Hello world"


def test_strip_html_decodes_entities():
    assert strip_html("&lt;b&gt;texto&lt;/b&gt;") == "<b>texto</b>"


def test_clean_whitespace():
    assert clean_whitespace("foo   \n  bar") == "foo bar"


def test_strip_empty():
    assert strip_html("") == ""
    assert strip_html("<br/>") == ""
