mirror of https://github.com/sveltejs/svelte
parent
11ada98565
commit
8e11fb608c
@ -1,3 +1,7 @@
|
|||||||
export default {
|
export default {
|
||||||
html: '<div>Foo</div>'
|
html: '<div>Foo</div>',
|
||||||
|
|
||||||
|
test({ assert, target }) {
|
||||||
|
assert.htmlEqual(target.innerHTML, '<div>Foo</div>');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
propTag: 'hr'
|
||||||
|
},
|
||||||
|
html: '<h1></h1><h2></h2><h3></h3><hr><input><br>',
|
||||||
|
|
||||||
|
test({ assert, component, target, ssrHtml }) {
|
||||||
|
assert.htmlEqual(target.innerHTML, '<h1></h1><h2></h2><h3></h3><hr><input><br>');
|
||||||
|
if (ssrHtml) {
|
||||||
|
assert.equal(ssrHtml, '<h1></h1>\n<h2></h2>\n<h3></h3>\n<hr>\n<input>\n<br>');
|
||||||
|
}
|
||||||
|
component.propTag = 'link';
|
||||||
|
assert.htmlEqual(target.innerHTML, '<h1></h1><h2></h2><h3></h3><link><input><br>');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<script>
|
||||||
|
export let propTag;
|
||||||
|
const static_tag = 'input';
|
||||||
|
const func_tag = () => 'br';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1></h1>
|
||||||
|
<svelte:element this="{'h2'}"></svelte:element>
|
||||||
|
<svelte:element this="h3"></svelte:element>
|
||||||
|
<svelte:element this="{propTag}"></svelte:element>
|
||||||
|
<svelte:element this="{static_tag}"></svelte:element>
|
||||||
|
<svelte:element this="{func_tag()}"></svelte:element>
|
||||||
Loading…
Reference in new issue