Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Apr 26, 2022
1 parent 195d317 commit 015a692
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest
import textwrap

from shiny import ui
from htmltools import HTMLDocument


def test_panel_title():
x = HTMLDocument(ui.panel_title("Hello Shiny UI")).render()["html"]
assert x == textwrap.dedent(
"""\
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script type="application/html-dependencies">headcontent_648f698a6bce952fe1b165140306e01f4da9e164[0.0]</script>
<title>Hello Shiny UI</title>
</head>
<body>
<h2>Hello Shiny UI</h2>
</body>
</html>"""
)

0 comments on commit 015a692

Please sign in to comment.