@@ -100,15 +100,10 @@ describe("useEnrichCellOutputs", () => {
100100 } ) ,
101101 ) ;
102102
103- const { result } = renderHook (
104- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
105- {
106- wrapper,
107- } ,
108- ) ;
103+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
109104
110- const enrichCellOutputs = result . current ;
111- const output = await enrichCellOutputs ( progress ) ;
105+ const takeScreenshots = result . current ;
106+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
112107
113108 expect ( output ) . toEqual ( { } ) ;
114109 expect ( document . getElementById ) . not . toHaveBeenCalled ( ) ;
@@ -137,15 +132,10 @@ describe("useEnrichCellOutputs", () => {
137132 } ) ,
138133 ) ;
139134
140- const { result } = renderHook (
141- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
142- {
143- wrapper,
144- } ,
145- ) ;
135+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
146136
147- const enrichCellOutputs = result . current ;
148- const output = await enrichCellOutputs ( progress ) ;
137+ const takeScreenshots = result . current ;
138+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
149139
150140 expect ( document . getElementById ) . toHaveBeenCalledWith (
151141 CellOutputId . create ( cellId ) ,
@@ -184,15 +174,10 @@ describe("useEnrichCellOutputs", () => {
184174 } ) ,
185175 ) ;
186176
187- const { result } = renderHook (
188- ( ) => useEnrichCellOutputs ( { snappy : true } ) ,
189- {
190- wrapper,
191- } ,
192- ) ;
177+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
193178
194- const enrichCellOutputs = result . current ;
195- const output = await enrichCellOutputs ( progress ) ;
179+ const takeScreenshots = result . current ;
180+ const output = await takeScreenshots ( { progress, snappy : true } ) ;
196181
197182 expect ( document . getElementById ) . toHaveBeenCalledWith (
198183 CellOutputId . create ( cellId ) ,
@@ -233,25 +218,22 @@ describe("useEnrichCellOutputs", () => {
233218 } ) ,
234219 ) ;
235220
236- const { result, rerender } = renderHook (
237- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
238- {
239- wrapper,
240- } ,
241- ) ;
221+ const { result, rerender } = renderHook ( ( ) => useEnrichCellOutputs ( ) , {
222+ wrapper,
223+ } ) ;
242224
243225 // First call - should capture
244- let enrichCellOutputs = result . current ;
245- let output = await enrichCellOutputs ( progress ) ;
226+ let takeScreenshots = result . current ;
227+ let output = await takeScreenshots ( { progress, snappy : false } ) ;
246228 expect ( output ) . toEqual ( { [ cellId ] : [ "image/png" , mockDataUrl ] } ) ;
247229 expect ( toPng ) . toHaveBeenCalledTimes ( 1 ) ;
248230
249231 // Rerender to get updated atom state
250232 rerender ( ) ;
251233
252234 // Second call with same output - should not capture again
253- enrichCellOutputs = result . current ;
254- output = await enrichCellOutputs ( progress ) ;
235+ takeScreenshots = result . current ;
236+ output = await takeScreenshots ( { progress, snappy : false } ) ;
255237 expect ( output ) . toEqual ( { } ) ; // Empty because output hasn't changed
256238 expect ( toPng ) . toHaveBeenCalledTimes ( 1 ) ; // Still only 1 call
257239 } ) ;
@@ -277,15 +259,10 @@ describe("useEnrichCellOutputs", () => {
277259 } ) ,
278260 ) ;
279261
280- const { result } = renderHook (
281- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
282- {
283- wrapper,
284- } ,
285- ) ;
262+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
286263
287- const enrichCellOutputs = result . current ;
288- const output = await enrichCellOutputs ( progress ) ;
264+ const takeScreenshots = result . current ;
265+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
289266
290267 expect ( output ) . toEqual ( { } ) ; // Failed screenshot should be filtered out
291268 expect ( Logger . error ) . toHaveBeenCalledWith (
@@ -312,15 +289,10 @@ describe("useEnrichCellOutputs", () => {
312289 } ) ,
313290 ) ;
314291
315- const { result } = renderHook (
316- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
317- {
318- wrapper,
319- } ,
320- ) ;
292+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
321293
322- const enrichCellOutputs = result . current ;
323- const output = await enrichCellOutputs ( progress ) ;
294+ const takeScreenshots = result . current ;
295+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
324296
325297 expect ( output ) . toEqual ( { } ) ;
326298 expect ( Logger . error ) . toHaveBeenCalledWith (
@@ -366,15 +338,10 @@ describe("useEnrichCellOutputs", () => {
366338 } ) ,
367339 ) ;
368340
369- const { result } = renderHook (
370- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
371- {
372- wrapper,
373- } ,
374- ) ;
341+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
375342
376- const enrichCellOutputs = result . current ;
377- const output = await enrichCellOutputs ( progress ) ;
343+ const takeScreenshots = result . current ;
344+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
378345
379346 expect ( output ) . toEqual ( {
380347 [ cell1 ] : [ "image/png" , mockDataUrl1 ] ,
@@ -417,15 +384,10 @@ describe("useEnrichCellOutputs", () => {
417384 } ) ,
418385 ) ;
419386
420- const { result } = renderHook (
421- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
422- {
423- wrapper,
424- } ,
425- ) ;
387+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
426388
427- const enrichCellOutputs = result . current ;
428- const output = await enrichCellOutputs ( progress ) ;
389+ const takeScreenshots = result . current ;
390+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
429391
430392 // Only the successful screenshot should be in the result
431393 expect ( output ) . toEqual ( {
@@ -461,22 +423,19 @@ describe("useEnrichCellOutputs", () => {
461423 } ) ,
462424 ) ;
463425
464- const { result, rerender } = renderHook (
465- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
466- {
467- wrapper,
468- } ,
469- ) ;
426+ const { result, rerender } = renderHook ( ( ) => useEnrichCellOutputs ( ) , {
427+ wrapper,
428+ } ) ;
470429
471430 // First screenshot
472- let enrichCellOutputs = result . current ;
473- let output = await enrichCellOutputs ( progress ) ;
431+ let takeScreenshots = result . current ;
432+ let output = await takeScreenshots ( { progress, snappy : false } ) ;
474433 expect ( output ) . toEqual ( { [ cellId ] : [ "image/png" , mockDataUrl1 ] } ) ;
475434
476435 // Second call - same output, should not be captured
477436 rerender ( ) ;
478- enrichCellOutputs = result . current ;
479- output = await enrichCellOutputs ( progress ) ;
437+ takeScreenshots = result . current ;
438+ output = await takeScreenshots ( { progress, snappy : false } ) ;
480439 expect ( output ) . toEqual ( { } ) ;
481440
482441 // Third call - output changed, should be captured
@@ -494,8 +453,8 @@ describe("useEnrichCellOutputs", () => {
494453 ) ;
495454
496455 rerender ( ) ;
497- enrichCellOutputs = result . current ;
498- output = await enrichCellOutputs ( progress ) ;
456+ takeScreenshots = result . current ;
457+ output = await takeScreenshots ( { progress, snappy : false } ) ;
499458 expect ( output ) . toEqual ( { [ cellId ] : [ "image/png" , mockDataUrl2 ] } ) ;
500459 expect ( toPng ) . toHaveBeenCalledTimes ( 2 ) ;
501460 } ) ;
@@ -532,15 +491,10 @@ describe("useEnrichCellOutputs", () => {
532491 } ) ,
533492 ) ;
534493
535- const { result } = renderHook (
536- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
537- {
538- wrapper,
539- } ,
540- ) ;
494+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
541495
542- const enrichCellOutputs = result . current ;
543- const output = await enrichCellOutputs ( progress ) ;
496+ const takeScreenshots = result . current ;
497+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
544498
545499 // None of these should trigger screenshots
546500 expect ( output ) . toEqual ( { } ) ;
@@ -562,15 +516,10 @@ describe("useEnrichCellOutputs", () => {
562516 } ) ,
563517 ) ;
564518
565- const { result } = renderHook (
566- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
567- {
568- wrapper,
569- } ,
570- ) ;
519+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
571520
572- const enrichCellOutputs = result . current ;
573- const output = await enrichCellOutputs ( progress ) ;
521+ const takeScreenshots = result . current ;
522+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
574523
575524 expect ( output ) . toEqual ( { } ) ;
576525 expect ( document . getElementById ) . not . toHaveBeenCalled ( ) ;
@@ -599,15 +548,10 @@ describe("useEnrichCellOutputs", () => {
599548 } ) ,
600549 ) ;
601550
602- const { result } = renderHook (
603- ( ) => useEnrichCellOutputs ( { snappy : false } ) ,
604- {
605- wrapper,
606- } ,
607- ) ;
551+ const { result } = renderHook ( ( ) => useEnrichCellOutputs ( ) , { wrapper } ) ;
608552
609- const enrichCellOutputs = result . current ;
610- const output = await enrichCellOutputs ( progress ) ;
553+ const takeScreenshots = result . current ;
554+ const output = await takeScreenshots ( { progress, snappy : false } ) ;
611555
612556 // Verify the exact return type structure
613557 expect ( output ) . toHaveProperty ( cellId ) ;
@@ -639,7 +583,6 @@ describe("updateCellOutputsWithScreenshots", () => {
639583 const updateCellOutputs = vi . fn ( ) . mockResolvedValue ( null ) ;
640584
641585 await updateCellOutputsWithScreenshots ( {
642- progress,
643586 takeScreenshots,
644587 updateCellOutputs,
645588 } ) ;
@@ -656,7 +599,6 @@ describe("updateCellOutputsWithScreenshots", () => {
656599 const updateCellOutputs = vi . fn ( ) . mockResolvedValue ( null ) ;
657600
658601 await updateCellOutputsWithScreenshots ( {
659- progress,
660602 takeScreenshots,
661603 updateCellOutputs,
662604 } ) ;
@@ -683,7 +625,6 @@ describe("updateCellOutputsWithScreenshots", () => {
683625 const updateCellOutputs = vi . fn ( ) . mockResolvedValue ( null ) ;
684626
685627 await updateCellOutputsWithScreenshots ( {
686- progress,
687628 takeScreenshots,
688629 updateCellOutputs,
689630 } ) ;
@@ -700,7 +641,6 @@ describe("updateCellOutputsWithScreenshots", () => {
700641
701642 // Should not throw - errors are caught and shown via toast
702643 await updateCellOutputsWithScreenshots ( {
703- progress,
704644 takeScreenshots,
705645 updateCellOutputs,
706646 } ) ;
@@ -733,7 +673,6 @@ describe("updateCellOutputsWithScreenshots", () => {
733673
734674 // Should not throw - errors are caught and shown via toast
735675 await updateCellOutputsWithScreenshots ( {
736- progress,
737676 takeScreenshots,
738677 updateCellOutputs,
739678 } ) ;
0 commit comments