@@ -2,6 +2,7 @@ import {describe, expect, it} from 'vitest';
22import { getReferenceSuggestions } from '../src/suggestion/getReferenceSuggestions' ;
33import { Flow } from "@code0-tech/sagittarius-graphql-types" ;
44import { DATA_TYPES , FUNCTION_SIGNATURES } from "./data" ;
5+ import { getTypesFromNode } from "../src" ;
56
67const node1Id = "gid://sagittarius/NodeFunction/1" as any ;
78const node2Id = "gid://sagittarius/NodeFunction/2" as any ;
@@ -201,4 +202,133 @@ describe('getReferenceSuggestions', () => {
201202
202203 expect ( suggestions . some ( s => s . nodeFunctionId === node1Id ) ) . toBe ( false ) ;
203204 } ) ;
205+
206+ it ( 'sd' , ( ) => {
207+ const flow : Flow = {
208+ "__typename" : "Flow" ,
209+ "id" : "gid://sagittarius/Flow/1" ,
210+ "createdAt" : "2026-03-17T14:02:31Z" ,
211+ "name" : "Test" ,
212+ "inputType" : "REST_ADAPTER_INPUT" ,
213+ "returnType" : "HTTP_RESPONSE" ,
214+ "nodes" : {
215+ "__typename" : "NodeFunctionConnection" ,
216+ "nodes" : [
217+ {
218+ "__typename" : "NodeFunction" ,
219+ "id" : "gid://sagittarius/NodeFunction/3" ,
220+ "functionDefinition" : {
221+ "__typename" : "FunctionDefinition" ,
222+ "id" : "gid://sagittarius/FunctionDefinition/7" ,
223+ "identifier" : "std::list::for_each"
224+ } ,
225+ "parameters" : {
226+ "__typename" : "NodeParameterConnection" ,
227+ "nodes" : [
228+ {
229+ "__typename" : "NodeParameter" ,
230+ "parameterDefinition" : {
231+ "__typename" : "ParameterDefinition" ,
232+ "id" : "gid://sagittarius/ParameterDefinition/10" ,
233+ "identifier" : "list"
234+ } ,
235+ "value" : {
236+ "__typename" : "LiteralValue" ,
237+ "value" : [
238+ 1 ,
239+ 2 ,
240+ 3 ,
241+ 4 ,
242+ 5
243+ ]
244+ }
245+ } ,
246+ {
247+ "__typename" : "NodeParameter" ,
248+ "parameterDefinition" : {
249+ "__typename" : "ParameterDefinition" ,
250+ "id" : "gid://sagittarius/ParameterDefinition/11" ,
251+ "identifier" : "consumer"
252+ } ,
253+ "value" : {
254+ "id" : "gid://sagittarius/NodeFunction/4" ,
255+ "__typename" : "NodeFunctionIdWrapper"
256+ }
257+ }
258+ ]
259+ }
260+ } ,
261+ {
262+ "__typename" : "NodeFunction" ,
263+ "id" : "gid://sagittarius/NodeFunction/4" ,
264+ "functionDefinition" : {
265+ "__typename" : "FunctionDefinition" ,
266+ "id" : "gid://sagittarius/FunctionDefinition/112" ,
267+ "identifier" : "std::control::value"
268+ } ,
269+ "parameters" : {
270+ "__typename" : "NodeParameterConnection" ,
271+ "nodes" : [
272+ {
273+ "__typename" : "NodeParameter" ,
274+ "parameterDefinition" : {
275+ "__typename" : "ParameterDefinition" ,
276+ "id" : "gid://sagittarius/ParameterDefinition/174" ,
277+ "identifier" : "value"
278+ } ,
279+ "value" : null
280+ }
281+ ]
282+ }
283+ }
284+ ]
285+ } ,
286+ "project" : {
287+ "__typename" : "NamespaceProject" ,
288+ "id" : "gid://sagittarius/NamespaceProject/1"
289+ } ,
290+ "settings" : {
291+ "__typename" : "FlowSettingConnection" ,
292+ "count" : 2 ,
293+ "nodes" : [
294+ {
295+ "__typename" : "FlowSetting" ,
296+ "id" : "gid://sagittarius/FlowSetting/1" ,
297+ "createdAt" : "2026-03-17T14:17:48Z" ,
298+ "updatedAt" : "2026-03-17T14:17:48Z" ,
299+ "flowSettingIdentifier" : "HTTP_METHOD" ,
300+ "value" : ""
301+ } ,
302+ {
303+ "__typename" : "FlowSetting" ,
304+ "id" : "gid://sagittarius/FlowSetting/2" ,
305+ "createdAt" : "2026-03-17T14:17:48Z" ,
306+ "updatedAt" : "2026-03-17T14:17:48Z" ,
307+ "flowSettingIdentifier" : "HTTP_URL" ,
308+ "value" : ""
309+ }
310+ ] ,
311+ "pageInfo" : {
312+ "__typename" : "PageInfo" ,
313+ "endCursor" : "Mg" ,
314+ "hasNextPage" : false
315+ }
316+ } ,
317+ "startingNodeId" : "gid://sagittarius/NodeFunction/3" ,
318+ "type" : {
319+ "__typename" : "FlowType" ,
320+ "id" : "gid://sagittarius/FlowType/1"
321+ } ,
322+ "userAbilities" : {
323+ "__typename" : "FlowUserAbilities" ,
324+ "deleteFlow" : true
325+ }
326+ } ;
327+
328+ const suggestions = getReferenceSuggestions ( flow , "gid://sagittarius/NodeFunction/4" , "any" , FUNCTION_SIGNATURES , DATA_TYPES ) ;
329+
330+ console . log ( JSON . stringify ( suggestions ) )
331+
332+ expect ( suggestions . some ( s => ! s . nodeFunctionId ) ) . toBe ( true ) ;
333+ } ) ;
204334} ) ;
0 commit comments