mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-29 22:12:05 +00:00
test: update parameter validation test for Issue #275 fix
The test expected empty strings to pass validation, but our Issue #275 fix intentionally rejects empty strings to prevent TypeErrors. Change: - Updated test from "should pass" to "should reject" - Now expects error: "String parameters cannot be empty" - Aligns with Issue #275 fix that eliminated 57.4% of production errors The old behavior (allowing empty strings) caused TypeErrors in getNodeTypeAlternatives(). The new behavior (rejecting empty strings) provides clear error messages and prevents crashes. Related: Issue #275 - TypeError prevention 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -74,12 +74,12 @@ describe('Parameter Validation', () => {
|
||||
}).toThrow('Missing required parameters for test_tool: nodeType');
|
||||
});
|
||||
|
||||
it('should pass when required parameter is empty string', () => {
|
||||
it('should reject when required parameter is empty string (Issue #275 fix)', () => {
|
||||
const args = { query: '', limit: 10 };
|
||||
|
||||
|
||||
expect(() => {
|
||||
server.testValidateToolParams('test_tool', args, ['query']);
|
||||
}).not.toThrow();
|
||||
}).toThrow('String parameters cannot be empty');
|
||||
});
|
||||
|
||||
it('should pass when required parameter is zero', () => {
|
||||
|
||||
Reference in New Issue
Block a user