mirror of https://github.com/sveltejs/svelte
Merge 24212cf102
into d287cc57d8
commit
e345937d3e
@ -0,0 +1,15 @@
|
|||||||
|
export default {
|
||||||
|
html: '<input type="text" value="Hello World"/>',
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({
|
||||||
|
options: {
|
||||||
|
type: 'text',
|
||||||
|
value: 'changed'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.htmlEqual( target.innerHTML, `<input type="text" value="changed"/>` );
|
||||||
|
component.teardown();
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,12 @@
|
|||||||
|
<input {{options}}/>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data: () => ({
|
||||||
|
options: {
|
||||||
|
type: 'text',
|
||||||
|
value: 'Hello World'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,2 @@
|
|||||||
|
<p>foo: {{foo}}</p>
|
||||||
|
<p>bar: {{bar}}</p>
|
@ -0,0 +1,22 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p>foo: 1</p>
|
||||||
|
<p>bar: 2</p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({
|
||||||
|
options: {
|
||||||
|
foo: 3,
|
||||||
|
bar: 4
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.equal( component.refs.widget.get( 'foo' ), 3 );
|
||||||
|
assert.htmlEqual( target.innerHTML, `
|
||||||
|
<p>foo: 3</p>
|
||||||
|
<p>bar: 4</p>
|
||||||
|
` );
|
||||||
|
component.teardown();
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,18 @@
|
|||||||
|
<Widget ref:widget {{options}}/>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Widget from './Widget.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data: () => ({
|
||||||
|
options: {
|
||||||
|
foo: 1,
|
||||||
|
bar: 2
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Widget
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,19 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<svg>
|
||||||
|
<defs>
|
||||||
|
<circle id='stamp' r='10' fill='blue'/>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<use xlink:href='#stamp' x='20' y='20'/>
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
const use = target.querySelector( 'use' );
|
||||||
|
const href = use.attributes[ 'xlink:href' ];
|
||||||
|
|
||||||
|
assert.equal( href.namespaceURI, 'http://www.w3.org/1999/xlink' );
|
||||||
|
|
||||||
|
component.teardown();
|
||||||
|
}
|
||||||
|
};
|
After Width: | Height: | Size: 229 B |
Loading…
Reference in new issue