File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,17 @@ def example_middle():
278278
279279@component
280280def 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)
356374def test_reactpy_to_string (vdom_in , html_out ):
You can’t perform that action at this time.
0 commit comments