Skip to content

Commit 09a5674

Browse files
committed
Fix coverage
1 parent db7676f commit 09a5674

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tests/test_utils.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,17 @@ def example_middle():
278278

279279
@component
280280
def example_child():
281-
return html.h1("Sample Application")
281+
return html.h1("Example")
282+
283+
284+
@component
285+
def example_str_return():
286+
return "Example"
287+
288+
289+
@component
290+
def example_none_return():
291+
return None
282292

283293

284294
@pytest.mark.parametrize(
@@ -341,16 +351,24 @@ def example_child():
341351
),
342352
(
343353
html.div(example_parent()),
344-
'<div><div id="sample" style="padding:15px"><h1>Sample Application</h1></div></div>',
354+
'<div><div id="sample" style="padding:15px"><h1>Example</h1></div></div>',
345355
),
346356
(
347357
example_parent(),
348-
'<div id="sample" style="padding:15px"><h1>Sample Application</h1></div>',
358+
'<div id="sample" style="padding:15px"><h1>Example</h1></div>',
349359
),
350360
(
351361
html.form({"acceptCharset": "utf-8"}),
352362
'<form accept-charset="utf-8"></form>',
353363
),
364+
(
365+
example_str_return(),
366+
"<div>Example</div>",
367+
),
368+
(
369+
example_none_return(),
370+
"",
371+
),
354372
],
355373
)
356374
def test_reactpy_to_string(vdom_in, html_out):

0 commit comments

Comments
 (0)