Added IconsHelper and updated Keyboard to support require_inside flag

This commit is contained in:
2026-02-20 20:35:09 +01:00
parent b09763b1eb
commit 13f292fc9d
12 changed files with 219 additions and 76 deletions

View File

@@ -0,0 +1,23 @@
from myfasthtml.controls.IconsHelper import IconsHelper
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 IconsHelper.get("does_not_exist") is None
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