reflex/tests/units/components/datadisplay/test_code.py
Elijah Ahianyo cd59ab5406
[ENG-4010]Codeblock cleanup in markdown (#4233)
* Codeblock cleanup in markdown

* Initial approach to getting this working with rx.memo and reflex web

* abstract the map var logic

* the tests are not valid + pyright fix

* darglint fix

* Add unit tests plus mix components

* pyi run

* rebase on main

* fix darglint

* testing different OS

* revert

* This should fix it. Right?

* Fix tests

* minor fn signature fix

* use ArgsFunctionOperation

* use destructured args and pass the tests

* fix remaining unit tests

* fix pyi files

* rebase on main

* move language regex on codeblock to markdown

* fix tests

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-07 19:18:14 -08:00

14 lines
360 B
Python

import pytest
from reflex.components.datadisplay.code import CodeBlock, Theme
@pytest.mark.parametrize(
"theme, expected",
[(Theme.one_light, "oneLight"), (Theme.one_dark, "oneDark")],
)
def test_code_light_dark_theme(theme, expected):
code_block = CodeBlock.create(theme=theme)
assert code_block.theme._js_expr == expected # type: ignore