Skip to content

Commit

Permalink
fix the test titles
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Feb 5, 2025
1 parent 2f32bc7 commit de005f9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/cli/src/__tests__/node-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,23 @@ describe('NodeTypes', () => {
);
});

it('should return the tool node-type when requested as tool', () => {
const result = nodeTypes.getByNameAndVersion('n8n-nodes-base.testNodeTool');
expect(result).not.toEqual(toolSupportingNode.type);
expect(result.description.name).toEqual('n8n-nodes-base.testNodeTool');
expect(result.description.displayName).toEqual('TestNode Tool');
expect(result.description.codex?.categories).toContain('AI');
expect(result.description.inputs).toEqual([]);
expect(result.description.outputs).toEqual(['ai_tool']);
});

it('should throw when a node-type is requested as tool, but is a community package', () => {
expect(() => nodeTypes.getByNameAndVersion('n8n-nodes-community.testNodeTool')).toThrow(
'Unrecognized node type: n8n-nodes-community.testNodeTool',
);
});

it('should throw when a node-type is requested as tool, but is a community package', () => {
it('should return a tool node-type from a community node, when requested as tool', () => {
globalConfig.nodes.communityPackages.allowToolUsage = true;
const result = nodeTypes.getByNameAndVersion('n8n-nodes-community.testNodeTool');
expect(result).not.toEqual(toolSupportingNode.type);
Expand All @@ -180,16 +190,6 @@ describe('NodeTypes', () => {
expect(result.description.outputs).toEqual(['ai_tool']);
});

it('should return the tool node-type when requested as tool', () => {
const result = nodeTypes.getByNameAndVersion('n8n-nodes-base.testNodeTool');
expect(result).not.toEqual(toolSupportingNode.type);
expect(result.description.name).toEqual('n8n-nodes-base.testNodeTool');
expect(result.description.displayName).toEqual('TestNode Tool');
expect(result.description.codex?.categories).toContain('AI');
expect(result.description.inputs).toEqual([]);
expect(result.description.outputs).toEqual(['ai_tool']);
});

it('should return a declarative node-type with an `.execute` method', () => {
const result = nodeTypes.getByNameAndVersion('n8n-nodes-base.declarativeNode');
expect(result).toBe(declarativeNode.type);
Expand Down

0 comments on commit de005f9

Please sign in to comment.