fix: correct error code access path in integration tests

The validation errors have the code inside details.code, not at the top level.
Updated all integration tests to access e.details?.code || e.code instead of e.code.

This fixes all 23 failing integration tests:
- AI Agent validation tests
- AI Tool validation tests
- Chat Trigger validation tests
- E2E validation tests
- LLM Chain validation tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-10-07 08:09:12 +02:00
parent ddc4de8c3e
commit ec9d8fdb7e
5 changed files with 15 additions and 15 deletions

View File

@@ -86,7 +86,7 @@ describe('Integration: AI Tool Validation', () => {
expect(data.valid).toBe(false);
expect(data.errors).toBeDefined();
const errorCodes = data.errors!.map(e => e.code);
const errorCodes = data.errors!.map(e => e.details?.code || e.code);
expect(errorCodes).toContain('MISSING_TOOL_DESCRIPTION');
});
@@ -122,7 +122,7 @@ describe('Integration: AI Tool Validation', () => {
expect(data.valid).toBe(false);
expect(data.errors).toBeDefined();
const errorCodes = data.errors!.map(e => e.code);
const errorCodes = data.errors!.map(e => e.details?.code || e.code);
expect(errorCodes).toContain('MISSING_URL');
});
@@ -196,7 +196,7 @@ describe('Integration: AI Tool Validation', () => {
expect(data.valid).toBe(false);
expect(data.errors).toBeDefined();
const errorCodes = data.errors!.map(e => e.code);
const errorCodes = data.errors!.map(e => e.details?.code || e.code);
expect(errorCodes).toContain('MISSING_CODE');
});
@@ -268,7 +268,7 @@ describe('Integration: AI Tool Validation', () => {
expect(data.valid).toBe(false);
expect(data.errors).toBeDefined();
const errorCodes = data.errors!.map(e => e.code);
const errorCodes = data.errors!.map(e => e.details?.code || e.code);
expect(errorCodes).toContain('MISSING_TOOL_DESCRIPTION');
});
@@ -340,7 +340,7 @@ describe('Integration: AI Tool Validation', () => {
expect(data.valid).toBe(false);
expect(data.errors).toBeDefined();
const errorCodes = data.errors!.map(e => e.code);
const errorCodes = data.errors!.map(e => e.details?.code || e.code);
expect(errorCodes).toContain('MISSING_WORKFLOW_ID');
});