Skip to content

Commit b5e4622

Browse files
author
nicosammito
committed
feat: update getReferenceSuggestions tests to ensure type compatibility for suggestions
1 parent c97bb10 commit b5e4622

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

test/getReferenceSuggestions.test.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,32 @@ describe('getReferenceSuggestions', () => {
172172
};
173173

174174
// Wir suchen nach einem String, node1 gibt aber NUMBER zurück
175-
const suggestions = getReferenceSuggestions(flow, node2Id, "string", FUNCTION_SIGNATURES, DATA_TYPES);
175+
const suggestions = getReferenceSuggestions(flow, node2Id, "TEXT", FUNCTION_SIGNATURES, DATA_TYPES);
176+
177+
expect(suggestions.some(s => s.nodeFunctionId === node1Id)).toBe(false);
178+
});
179+
180+
it('sollte nur Typ-kompatible Vorschläge machen', () => {
181+
const flow: Flow = {
182+
nodes: {
183+
nodes: [
184+
{
185+
id: node1Id,
186+
functionDefinition: {identifier: "std::number::add"},
187+
parameters: {nodes: []},
188+
nextNodeId: node2Id
189+
},
190+
{
191+
id: node2Id,
192+
functionDefinition: {identifier: "std::number::add"},
193+
parameters: {nodes: []}
194+
}
195+
]
196+
}
197+
};
198+
199+
// Wir suchen nach einem String, node1 gibt aber NUMBER zurück
200+
const suggestions = getReferenceSuggestions(flow, node2Id, "TEXT", FUNCTION_SIGNATURES, DATA_TYPES);
176201

177202
expect(suggestions.some(s => s.nodeFunctionId === node1Id)).toBe(false);
178203
});

0 commit comments

Comments
 (0)