Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,28 @@ test('svg mixed with html', function (t) {
t.equal(vdom.create(tree).toString(), expected)
t.end()
})

test('svg mixed with html and close / self-closing tags', function (t) {
var expected = `<div>
<h3>test</h3>
<svg width="150" height="100" viewBox="0 0 3 2">
<use id="test"></use>
<rect width="1" height="2" x="0" fill="#008d46"></rect>
<use id="test"></use>
<rect width="1" height="2" x="0" fill="#008d46"></rect>
<use id="test"></use>
</svg>
</div>`
var tree = hx`<div>
<h3>test</h3>
<svg width="150" height="100" viewBox="0 0 3 2">
<use id="test"></use>
<rect width="1" height="2" x="0" fill="#008d46"></rect>
<use id="test"/>
<rect width="1" height="2" x="0" fill="#008d46"/>
<use id="test"></use>
</svg>
</div>`
t.equal(vdom.create(tree).toString(), expected)
t.end()
})