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