@@ -165,14 +165,10 @@ describe("diffs tool", () => {
165165 expect ( result ?. content ) . toHaveLength ( 1 ) ;
166166 const details = readDetails ( result ) ;
167167 expect ( requireString ( details . filePath , "filePath" ) ) . toMatch ( / p r e v i e w \. p n g $ / ) ;
168- expect ( requireString ( details . imagePath , "imagePath" ) ) . toMatch ( / p r e v i e w \. p n g $ / ) ;
169- expect ( details . format ) . toBe ( "png" ) ;
168+ expect ( details . fileFormat ) . toBe ( "png" ) ;
170169 expect ( details . fileQuality ) . toBe ( "standard" ) ;
171- expect ( details . imageQuality ) . toBe ( "standard" ) ;
172170 expect ( details . fileScale ) . toBe ( 2 ) ;
173- expect ( details . imageScale ) . toBe ( 2 ) ;
174171 expect ( details . fileMaxWidth ) . toBe ( 960 ) ;
175- expect ( details . imageMaxWidth ) . toBe ( 960 ) ;
176172 expect ( details . viewerUrl ) . toBeUndefined ( ) ;
177173 expect ( cleanupSpy ) . toHaveBeenCalledTimes ( 1 ) ;
178174 } ) ;
@@ -200,7 +196,7 @@ describe("diffs tool", () => {
200196
201197 expect ( screenshotter [ "screenshotHtml" ] ) . toHaveBeenCalledTimes ( 1 ) ;
202198 expect ( readTextContent ( result , 0 ) ) . toContain ( "Diff PDF generated at:" ) ;
203- expect ( ( result . details as Record < string , unknown > ) . format ) . toBe ( "pdf" ) ;
199+ expect ( ( result . details as Record < string , unknown > ) . fileFormat ) . toBe ( "pdf" ) ;
204200 expect ( ( result . details as Record < string , unknown > ) . filePath ) . toMatch ( / p r e v i e w \. p d f $ / ) ;
205201 } ) ;
206202
@@ -302,52 +298,6 @@ describe("diffs tool", () => {
302298 }
303299 } ) ;
304300
305- it ( "accepts image* tool options for backward compatibility" , async ( ) => {
306- const screenshotter = createPngScreenshotter ( {
307- assertImage : ( image ) => {
308- expect ( image . qualityPreset ) . toBe ( "hq" ) ;
309- expect ( image . scale ) . toBe ( 2.4 ) ;
310- expect ( image . maxWidth ) . toBe ( 1100 ) ;
311- } ,
312- } ) ;
313-
314- const tool = createToolWithScreenshotter ( store , screenshotter ) ;
315-
316- const result = await tool . execute ?.( "tool-2legacy" , {
317- before : "one\n" ,
318- after : "two\n" ,
319- mode : "file" ,
320- imageQuality : "hq" ,
321- imageScale : "2.4" ,
322- imageMaxWidth : "1100" ,
323- } ) ;
324-
325- expect ( ( result . details as Record < string , unknown > ) . fileQuality ) . toBe ( "hq" ) ;
326- expect ( ( result . details as Record < string , unknown > ) . fileScale ) . toBe ( 2.4 ) ;
327- expect ( ( result . details as Record < string , unknown > ) . fileMaxWidth ) . toBe ( 1100 ) ;
328- } ) ;
329-
330- it ( "accepts deprecated format alias for fileFormat" , async ( ) => {
331- const screenshotter = createPdfScreenshotter ( ) ;
332-
333- const tool = createDiffsTool ( {
334- api : createApi ( ) ,
335- store,
336- defaults : DEFAULT_DIFFS_TOOL_DEFAULTS ,
337- screenshotter,
338- } ) ;
339-
340- const result = await tool . execute ?.( "tool-2format" , {
341- before : "one\n" ,
342- after : "two\n" ,
343- mode : "file" ,
344- format : "pdf" ,
345- } ) ;
346-
347- expect ( ( result . details as Record < string , unknown > ) . fileFormat ) . toBe ( "pdf" ) ;
348- expect ( ( result . details as Record < string , unknown > ) . filePath ) . toMatch ( / p r e v i e w \. p d f $ / ) ;
349- } ) ;
350-
351301 it ( "honors defaults.mode=file when mode is omitted" , async ( ) => {
352302 const screenshotter = createPngScreenshotter ( ) ;
353303 const tool = createToolWithScreenshotter ( store , screenshotter , {
@@ -384,7 +334,6 @@ describe("diffs tool", () => {
384334 expect ( result ?. content ) . toHaveLength ( 1 ) ;
385335 expect ( readTextContent ( result , 0 ) ) . toContain ( "File rendering failed" ) ;
386336 expect ( ( result . details as Record < string , unknown > ) . fileError ) . toBe ( "browser missing" ) ;
387- expect ( ( result . details as Record < string , unknown > ) . imageError ) . toBe ( "browser missing" ) ;
388337 } ) ;
389338
390339 it ( "rejects invalid base URLs as tool input errors" , async ( ) => {
@@ -539,7 +488,7 @@ describe("diffs tool", () => {
539488
540489 expect ( ( result . details as Record < string , unknown > ) . mode ) . toBe ( "both" ) ;
541490 expect ( screenshotter [ "screenshotHtml" ] ) . toHaveBeenCalledTimes ( 1 ) ;
542- expect ( ( result . details as Record < string , unknown > ) . format ) . toBe ( "png" ) ;
491+ expect ( ( result . details as Record < string , unknown > ) . fileFormat ) . toBe ( "png" ) ;
543492 expect ( ( result . details as Record < string , unknown > ) . fileQuality ) . toBe ( "print" ) ;
544493 expect ( ( result . details as Record < string , unknown > ) . fileScale ) . toBe ( 2.75 ) ;
545494 expect ( ( result . details as Record < string , unknown > ) . fileMaxWidth ) . toBe ( 1320 ) ;
0 commit comments