Skip to content

Commit

Permalink
add test from gh-2086
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jul 9, 2019
1 parent f2d2582 commit 85e25a9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
@@ -0,0 +1,5 @@
<svelte:head>
<meta name="description" content="A"/>
</svelte:head>

A
@@ -0,0 +1,5 @@
<svelte:head>
<meta name="description" content="B"/>
</svelte:head>

B
15 changes: 15 additions & 0 deletions test/runtime/samples/head-detached-in-dynamic-component/_config.js
@@ -0,0 +1,15 @@
export default {
html: `
A
`,

test({ assert, component, window }) {
component.x = false;

const meta = window.document.querySelectorAll('meta');

assert.equal(meta.length, 1);
assert.equal(meta[0].name, 'description');
assert.equal(meta[0].content, 'B');
}
};
@@ -0,0 +1,8 @@
<script>
import A from './A.svelte';
import B from './B.svelte';
export let x = true;
</script>

<svelte:component this="{x ? A : B}"/>

0 comments on commit 85e25a9

Please sign in to comment.