File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
test/compiler/svg-child-component Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ < rect x ='{{x}} ' y ='{{y}} ' width ='{{width}} ' height ='{{height}} '/>
Original file line number Diff line number Diff line change
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
+ } ;
Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments