Skip to content

Commit 83e9ed9

Browse files
committed
add a failing test for svg rendered via child component
1 parent ddb31b6 commit 83e9ed9

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<rect x='{{x}}' y='{{y}}' width='{{width}}' height='{{height}}'/>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default {
2+
skip: true,
3+
data: {
4+
x: 0,
5+
y: 0,
6+
width: 100,
7+
height: 100
8+
},
9+
html: `<svg><rect x="0" y="0" width="100" height="100"></rect></svg>`,
10+
test ( assert, component, target ) {
11+
const svg = target.querySelector( 'svg' );
12+
const rect = target.querySelector( 'rect' );
13+
14+
assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' );
15+
assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' );
16+
17+
component.set({ width: 150, height: 50 });
18+
assert.equal( target.innerHTML, `<svg><rect x="0" y="0" width="150" height="50"></rect></svg>` );
19+
}
20+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<svg>
2+
<Rect x='{{x}}' y='{{y}}' width='{{width}}' height='{{height}}'/>
3+
</svg>
4+
<script>
5+
import Rect from './Rect.html';
6+
7+
export default {
8+
components: { Rect }
9+
};
10+
</script>

0 commit comments

Comments
 (0)