test_link.py 491 B

12345678910111213
  1. from reflex.components.base.link import RawLink, ScriptTag
  2. def test_raw_link():
  3. raw_link = RawLink.create("https://example.com").render()
  4. assert raw_link["name"] == '"link"'
  5. assert raw_link["children"][0]["contents"] == '"https://example.com"'
  6. def test_script_tag():
  7. script_tag = ScriptTag.create("console.log('Hello, world!');").render()
  8. assert script_tag["name"] == '"script"'
  9. assert script_tag["children"][0]["contents"] == "\"console.log('Hello, world!');\""