Support define is tool logic function (#17926)
- supports isTool and timeout settings in defineLogicFunction in apps and in setting tabs definition - compute for all toolInputSchema for logic funciton, in settings and in code steps <img width="991" height="802" alt="image" src="https://github.com/user-attachments/assets/05dc1221-cac9-45a3-87b0-3b13161446fd" />
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { isValidVariable } from '@/utils/validation/isValidVariable';
|
||||
|
||||
describe('isValidVariable', () => {
|
||||
it('should return true for valid variable syntax', () => {
|
||||
expect(isValidVariable('{{step.output}}')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for nested variable', () => {
|
||||
expect(isValidVariable('{{trigger.output.name}}')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for string without brackets', () => {
|
||||
expect(isValidVariable('no brackets')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for partial brackets', () => {
|
||||
expect(isValidVariable('{{incomplete')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for empty brackets', () => {
|
||||
expect(isValidVariable('{{}}')).toBe(false);
|
||||
});
|
||||
});
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import { getCountryCodesForCallingCode } from '@/utils/validation/phones-value/getCountryCodesForCallingCode';
|
||||
|
||||
describe('getCountryCodesForCallingCode', () => {
|
||||
it('should return country codes for calling code 1 (US/CA)', () => {
|
||||
const result = getCountryCodesForCallingCode('1');
|
||||
|
||||
expect(result).toContain('US');
|
||||
expect(result).toContain('CA');
|
||||
});
|
||||
|
||||
it('should handle + prefix', () => {
|
||||
const result = getCountryCodesForCallingCode('+33');
|
||||
|
||||
expect(result).toContain('FR');
|
||||
});
|
||||
|
||||
it('should return empty array for invalid calling code', () => {
|
||||
expect(getCountryCodesForCallingCode('99999')).toEqual([]);
|
||||
});
|
||||
});
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import { isValidCountryCode } from '@/utils/validation/phones-value/isValidCountryCode';
|
||||
|
||||
describe('isValidCountryCode', () => {
|
||||
it('should return true for valid country code US', () => {
|
||||
expect(isValidCountryCode('US')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for valid country code FR', () => {
|
||||
expect(isValidCountryCode('FR')).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for invalid country code', () => {
|
||||
expect(isValidCountryCode('XX')).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for lowercase', () => {
|
||||
expect(isValidCountryCode('us')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user