File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ const tiger = new SVGAsset(
55
55
800
56
56
) ;
57
57
58
+ const text = new SVGAsset (
59
+ `<svg viewBox='0 0 290 500' width='290' height='325' xmlns='http://www.w3.org/2000/svg'>
60
+ <circle cx='31' cy='325' r='120px' fill='#c02aaa'/>
61
+ <text x="20" y="35" fill="black">My Text</text>
62
+ </svg>` ,
63
+ 290 ,
64
+ 500
65
+ ) ;
66
+
58
67
const svgWithoutSize = {
59
68
__typename__ : "SVG" as const ,
60
69
width ( ) {
@@ -66,7 +75,7 @@ const svgWithoutSize = {
66
75
dispose ( ) { } ,
67
76
source ( ) {
68
77
return `<svg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'>
69
- <circle cx='10' cy='10' r='10' fill='#00FFFF'/>
78
+ <circle cx='10' cy='10' r='10' fill='#00FFFF' />
70
79
</svg>` ;
71
80
} ,
72
81
} ;
@@ -195,4 +204,14 @@ describe("Displays SVGs", () => {
195
204
) ;
196
205
checkImage ( image , docPath ( "opacity-tiger.png" ) ) ;
197
206
} ) ;
207
+
208
+ itRunsE2eOnly ( "can render text" , async ( ) => {
209
+ const image = await surface . draw (
210
+ < >
211
+ < Fill color = "white" />
212
+ < ImageSVG svg = { text } x = { 0 } y = { 0 } width = { 800 } height = { 800 } />
213
+ </ >
214
+ ) ;
215
+ checkImage ( image , "snapshots/svg/text.png" ) ;
216
+ } ) ;
198
217
} ) ;
You can’t perform that action at this time.
0 commit comments