Skip to content

Commit

Permalink
add a failing test for svg rendered via child component
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Dec 7, 2016
1 parent ddb31b6 commit 83e9ed9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/compiler/svg-child-component/Rect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<rect x='{{x}}' y='{{y}}' width='{{width}}' height='{{height}}'/>
20 changes: 20 additions & 0 deletions test/compiler/svg-child-component/_config.js
Original file line number Diff line number Diff line change
@@ -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>` );
}
};
10 changes: 10 additions & 0 deletions test/compiler/svg-child-component/main.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 83e9ed9

Please sign in to comment.