mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
493 B
26 lines
493 B
6 years ago
|
export default {
|
||
|
preserveIdentifiers: true,
|
||
|
|
||
|
props: {
|
||
|
links: ['a', 'b', 'c']
|
||
|
},
|
||
|
|
||
|
html: `
|
||
|
<a href="x#a">x#a</a>
|
||
|
<a href="x#b">x#b</a>
|
||
|
<a href="x#c">x#c</a>
|
||
|
`,
|
||
|
|
||
|
test({ assert, component, target }) {
|
||
|
component.links = ['d', 'e', 'f'];
|
||
|
|
||
|
const links = [...target.querySelectorAll('a')];
|
||
|
assert.deepEqual(links.map(l => l.href), ['x#d', 'x#e', 'x#f']);
|
||
|
|
||
|
assert.htmlEqual(target.innerHTML, `
|
||
|
<a href="x#d">x#d</a>
|
||
|
<a href="x#e">x#e</a>
|
||
|
<a href="x#f">x#f</a>
|
||
|
`);
|
||
|
}
|
||
|
};
|