mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Do not show [object Object] in error message when validating type (no-changelog) (#9591)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { validateFieldType } from '@/TypeValidation';
|
||||
import { getValueDescription, validateFieldType } from '@/TypeValidation';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
const VALID_ISO_DATES = [
|
||||
@@ -230,4 +230,15 @@ describe('Type Validation', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('getValueDescription util function', () => {
|
||||
it('should return correct description', () => {
|
||||
expect(getValueDescription('foo')).toBe("'foo'");
|
||||
expect(getValueDescription(42)).toBe("'42'");
|
||||
expect(getValueDescription(true)).toBe("'true'");
|
||||
expect(getValueDescription(null)).toBe("'null'");
|
||||
expect(getValueDescription(undefined)).toBe("'undefined'");
|
||||
expect(getValueDescription([{}])).toBe('array');
|
||||
expect(getValueDescription({})).toBe('object');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user