account for new mapping in unit tests

This commit is contained in:
Masen Furer 2025-01-10 12:02:37 -08:00
parent 615d29eeb1
commit fe66dd77dd
No known key found for this signature in database
GPG Key ID: B0008AD22B3B3A95

View File

@ -1,13 +1,19 @@
import pytest
from reflex.components.lucide.icon import LUCIDE_ICON_LIST, Icon
from reflex.components.lucide.icon import (
LUCIDE_ICON_LIST,
LUCIDE_ICON_MAPPING_OVERRIDE,
Icon,
)
from reflex.utils import format
@pytest.mark.parametrize("tag", LUCIDE_ICON_LIST)
def test_icon(tag):
icon = Icon.create(tag)
assert icon.alias == f"Lucide{format.to_title_case(tag)}Icon"
assert icon.alias == "Lucide" + LUCIDE_ICON_MAPPING_OVERRIDE.get(
tag, f"{format.to_title_case(tag)}Icon"
)
def test_icon_missing_tag():