Files
MyFastHtml/tests/controls/test_icons_helper.py
2026-03-11 20:59:07 +01:00

24 lines
627 B
Python

from myfasthtml.controls.IconsHelper import IconsHelper
from myfasthtml.test.matcher import matches, TestIconNotStr
def test_existing_icon():
IconsHelper.reset()
assert IconsHelper.get(True) is not None
def test_dynamic_icon():
IconsHelper.reset()
assert IconsHelper.get("add20_filled") is not None
def test_unknown_icon():
IconsHelper.reset()
assert matches(IconsHelper.get("does_not_exist"), TestIconNotStr("Question20Regular"))
def test_dynamic_icon_by_package():
IconsHelper.reset()
assert IconsHelper.get("add20_filled", "fa") is None
assert IconsHelper.get("add20_filled", "fluent") is not None