0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

some more tests

This commit is contained in:
Rich-Harris 2016-11-23 10:47:49 -05:00
parent 2ed34f4fe2
commit 978a2bcae7
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,14 @@
export default {
html: `
<p>1</p>
<p>2</p>
`,
test ( assert, component, target ) {
component.set({ foo: 2 });
assert.htmlEqual( target.innerHTML, `
<p>2</p>
<p>4</p>
` );
}
};

View File

@ -0,0 +1,16 @@
<p>{{foo}}</p>
<p>{{bar}}</p>
<script>
export default {
data: () => ({
foo: 1
}),
onrender () {
this.observe( 'foo', foo => {
this.set({ bar: foo * 2 });
});
}
};
</script>

View File

@ -0,0 +1,3 @@
export default {
html: '<p>2</p>'
};

View File

@ -0,0 +1,13 @@
<p>{{foo}}</p>
<script>
export default {
data: () => ({
foo: 1
}),
onrender () {
this.set({ foo: 2 });
}
};
</script>