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:
czlonkowski
2025-10-06 08:21:17 +02:00
parent 44568a6edd
commit af949b09a5

View File

@@ -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', () => {