@@ -195,6 +195,7 @@ test('the default destination is a reserved temp file, removed when the capture
195195
196196 await expect ( resolved . execute ( executionParams ( session , req ) ) ) . rejects . toThrow ( / c a p t u r e f a i l e d / ) ;
197197 expect ( path . basename ( requestedPath ?? '' ) ) . toBe ( 'screenshot.png' ) ;
198+ expect ( path . basename ( path . dirname ( requestedPath ?? '' ) ) ) . toContain ( 'agent-device-screenshot-' ) ;
198199 expect ( fs . existsSync ( path . dirname ( requestedPath ?? '' ) ) ) . toBe ( false ) ;
199200} ) ;
200201
@@ -257,7 +258,7 @@ const CROP_TREE = [
257258 } ,
258259] ;
259260
260- test ( 'the crop runs after the platform write and before the shared scale ' , async ( ) => {
261+ test ( 'the crop runs against the platform screenshot dimensions ' , async ( ) => {
261262 const fixture = screenshotRuntimeFixture ( {
262263 snapshotResult : ( ) => ( {
263264 nodes : CROP_TREE ,
@@ -272,7 +273,7 @@ test('the crop runs after the platform write and before the shared scale', async
272273 ) ;
273274 const req = screenshotRequest ( {
274275 positionals : [ outPath ] ,
275- flags : { screenshotCropOn : 'label="Save"' , screenshotScale : 0.5 } ,
276+ flags : { screenshotCropOn : 'label="Save"' } ,
276277 } ) ;
277278
278279 const resolved = await resolveScreenshotGenericExecution ( {
@@ -283,14 +284,11 @@ test('the crop runs after the platform write and before the shared scale', async
283284 inspectFacts : fixture . inspectFacts ,
284285 bindDevice : fixture . bindDevice ,
285286 } ) ;
286- const result = await executeResult ( resolved , session , req , { screenshotScale : 0.5 } ) ;
287+ const result = await executeResult ( resolved , session , req ) ;
287288
288289 expect ( fixture . captureScreenshot ) . toHaveBeenCalledTimes ( 1 ) ;
289290 expect ( fixture . captureSnapshot ) . toHaveBeenCalledTimes ( 1 ) ;
290- // The platform wrote 100x50; the pre-scale box is 40x20, so only a crop-then-scale pipeline
291- // lands on 20x10 — a scale-then-crop pipeline would halve the image first and the same box
292- // would overflow it.
293- expect ( result ) . toMatchObject ( { width : 20 , height : 10 } ) ;
291+ expect ( result ) . toMatchObject ( { width : 40 , height : 20 } ) ;
294292 expect ( fixture . captureSnapshot . mock . calls [ 0 ] ?. [ 0 ] . options ) . toMatchObject ( {
295293 interactiveOnly : false ,
296294 includeRects : true ,
0 commit comments