Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit 3fdeb60

Browse files
committed
Additional test
1 parent 1bd2795 commit 3fdeb60

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/live_view_native/template/parser_test.exs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,26 @@ defmodule LiveViewNative.Template.ParserTest do
355355
]
356356
end
357357

358+
test "text_as_node: true and inject_identity: true will create a text node tuple instead of text with the correct identity value" do
359+
{:ok, nodes} = """
360+
<Foo> <Bar><Baz></Baz></Bar><Qux/></Foo>
361+
<FooBar>Baz</FooBar>
362+
"""
363+
|> parse_document(text_as_node: true, inject_identity: true)
364+
365+
assert nodes == [
366+
{"Foo", [{"_id", 1}], [
367+
{"Bar", [{"_id", 2}], [
368+
{"Baz", [{"_id", 3}], []}
369+
]},
370+
{"Qux", [{"_id", 4}], []}
371+
]},
372+
{"FooBar", [{"_id", 5}], [
373+
{:text, [{"_id", 6}], "Baz"}
374+
]}
375+
]
376+
end
377+
358378
test "strip_comments: true will not parse comments" do
359379
{:ok, nodes} = """
360380
<FooBar></FooBar>

0 commit comments

Comments
 (0)