add a failing test for svg rendered via child component

pull/120/merge
Arpad Borsos 8 years ago
parent ddb31b6e9e
commit 83e9ed9111
No known key found for this signature in database
GPG Key ID: 908EDF65263368B4

@ -0,0 +1 @@
<rect x='{{x}}' y='{{y}}' width='{{width}}' height='{{height}}'/>

@ -0,0 +1,20 @@
export default {
skip: true,
data: {
x: 0,
y: 0,
width: 100,
height: 100
},
html: `<svg><rect x="0" y="0" width="100" height="100"></rect></svg>`,
test ( assert, component, target ) {
const svg = target.querySelector( 'svg' );
const rect = target.querySelector( 'rect' );
assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' );
assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' );
component.set({ width: 150, height: 50 });
assert.equal( target.innerHTML, `<svg><rect x="0" y="0" width="150" height="50"></rect></svg>` );
}
};

@ -0,0 +1,10 @@
<svg>
<Rect x='{{x}}' y='{{y}}' width='{{width}}' height='{{height}}'/>
</svg>
<script>
import Rect from './Rect.html';
export default {
components: { Rect }
};
</script>

After

Width:  |  Height:  |  Size: 178 B

Loading…
Cancel
Save