reflex/tests/units/components/base/test_link.py
Thomas Brandého 3f538865b5
reorganize all tests in a single top folder (#3981)
* lift node version restraint to allow more recent version if already installed

* add node test for latest version

* change python version

* use purple for debug logs

* update workflow

* add playwright dev dependency

* update workflow

* change test

* oops

* improve test

* update test

* fix tests

* mv units tests to a subfolder

* reorganize tests

* fix install

* update test_state

* revert node changes and only keep new tests organization

* move integration tests in tests/integration

* fix integration workflow

* fix dockerfile workflow

* fix dockerfile workflow 2

* fix shared_state
2024-09-26 01:22:52 +02:00

16 lines
507 B
Python

from reflex.components.base.link import RawLink, ScriptTag
def test_raw_link():
raw_link = RawLink.create("https://example.com").render()
assert raw_link["name"] == "link"
assert raw_link["children"][0]["contents"] == '{"https://example.com"}'
def test_script_tag():
script_tag = ScriptTag.create("console.log('Hello, world!');").render()
assert script_tag["name"] == "script"
assert (
script_tag["children"][0]["contents"] == "{\"console.log('Hello, world!');\"}"
)