@@ -4,40 +4,8 @@ import { createMockExecutor, createNoopExecutor } from '../../../../test-utils/m
44import type { CommandExecutor } from '../../../../utils/execution/index.ts' ;
55import { schema , handler , snapshot_uiLogic } from '../snapshot_ui.ts' ;
66import { AXE_NOT_AVAILABLE_MESSAGE } from '../../../../utils/axe-helpers.ts' ;
7- import { allText , createMockToolHandlerContext } from '../../../../test-utils/test-helpers.ts' ;
8-
9- const runLogic = async ( logic : ( ) => Promise < unknown > ) => {
10- const { result, run } = createMockToolHandlerContext ( ) ;
11- const response = await run ( logic ) ;
12-
13- if (
14- response &&
15- typeof response === 'object' &&
16- 'content' in ( response as Record < string , unknown > )
17- ) {
18- return response as {
19- content : Array < { type : string ; text ?: string ; data ?: string ; mimeType ?: string } > ;
20- isError ?: boolean ;
21- nextStepParams ?: unknown ;
22- } ;
23- }
24-
25- const text = result . text ( ) ;
26- const textContent = text . length > 0 ? [ { type : 'text' as const , text } ] : [ ] ;
27- const imageContent = result . attachments . map ( ( attachment ) => ( {
28- type : 'image' as const ,
29- data : attachment . data ,
30- mimeType : attachment . mimeType ,
31- } ) ) ;
32-
33- return {
34- content : [ ...textContent , ...imageContent ] ,
35- isError : result . isError ( ) ? true : undefined ,
36- nextStepParams : result . nextStepParams ,
37- attachments : result . attachments ,
38- text,
39- } ;
40- } ;
7+ import { allText , runLogic } from '../../../../test-utils/test-helpers.ts' ;
8+
419
4210describe ( 'Snapshot UI Plugin' , ( ) => {
4311 describe ( 'Export Field Validation (Literal)' , ( ) => {
0 commit comments