@@ -219,6 +219,54 @@ describe("blobs", () => {
219219 / s v g O p t i o n s .* o b j e c t .* n u l l / g,
220220 ) ;
221221 } ) ;
222+
223+ runSuite < SvgOptions > ( {
224+ functionBeingTested : ( svgOptions ) => svg ( genBlobOptions ( ) , svgOptions ) ,
225+ optionsGenerator : genSvgOptions ,
226+ } ) ( [
227+ // fill
228+ {
229+ name : "should accept valid svgOptions fill" ,
230+ edit : ( svgOptions ) => ( svgOptions . fill = "red" ) ,
231+ } ,
232+ {
233+ name : "should accept undefined svgOptions fill" ,
234+ edit : ( svgOptions ) => delete svgOptions ?. fill ,
235+ } ,
236+ {
237+ name : "should reject broken svgOptions fill" ,
238+ edit : ( svgOptions ) => ( svgOptions . fill = null as any ) ,
239+ error : / s v g O p t i o n s .* f i l l .* s t r i n g .* n u l l / g,
240+ } ,
241+ // stroke
242+ {
243+ name : "should accept valid svgOptions stroke" ,
244+ edit : ( svgOptions ) => ( svgOptions . stroke = "red" ) ,
245+ } ,
246+ {
247+ name : "should accept undefined svgOptions stroke" ,
248+ edit : ( svgOptions ) => delete svgOptions ?. stroke ,
249+ } ,
250+ {
251+ name : "should reject broken svgOptions stroke" ,
252+ edit : ( svgOptions ) => ( svgOptions . stroke = null as any ) ,
253+ error : / s v g O p t i o n s .* s t r o k e .* s t r i n g .* n u l l / g,
254+ } ,
255+ // strokeWidth
256+ {
257+ name : "should accept valid svgOptions strokeWidth" ,
258+ edit : ( svgOptions ) => ( svgOptions . strokeWidth = 222 ) ,
259+ } ,
260+ {
261+ name : "should accept undefined svgOptions strokeWidth" ,
262+ edit : ( svgOptions ) => delete svgOptions ?. strokeWidth ,
263+ } ,
264+ {
265+ name : "should reject broken svgOptions strokeWidth" ,
266+ edit : ( svgOptions ) => ( svgOptions . strokeWidth = NaN ) ,
267+ error : / s v g O p t i o n s .* s t r o k e W i d t h .* n u m b e r .* N a N / g,
268+ } ,
269+ ] ) ;
222270 } ) ;
223271 } ) ;
224272
0 commit comments