Fix wrong empty string formatting (#15949)
As title, solves this kind of issues https://twentyfortwenty.twenty.com/object/workflowRun/d6aca50e-68ba-4715-8835-ea22bd44fb88 Solves null currencyDisplay when null currencyCode and null amountMicros ### Before <img width="147" height="81" alt="image" src="https://github.com/user-attachments/assets/d250d65e-b984-43f4-ad67-1397a684cf6a" /> ### After <img width="128" height="74" alt="image" src="https://github.com/user-attachments/assets/4f9c9d80-f8bb-495a-9be0-ecfb984ded81" />
This commit is contained in:
@@ -10,12 +10,31 @@ describe('resolveInput', () => {
|
||||
theme: 'dark',
|
||||
notifications: true,
|
||||
},
|
||||
specialValues: {
|
||||
nullValue: null,
|
||||
undefinedValue: undefined,
|
||||
emptyString: '',
|
||||
zero: 0,
|
||||
booleanFalse: false,
|
||||
booleanTrue: true,
|
||||
},
|
||||
};
|
||||
|
||||
it('should return null for null input', () => {
|
||||
expect(resolveInput(null, context)).toBeNull();
|
||||
});
|
||||
|
||||
it('should support special values', () => {
|
||||
expect(resolveInput('{{specialValues.nullValue}}', context)).toBeNull();
|
||||
expect(
|
||||
resolveInput('{{specialValues.undefinedValue}}', context),
|
||||
).toBeUndefined();
|
||||
expect(resolveInput('{{specialValues.emptyString}}', context)).toBe('');
|
||||
expect(resolveInput('{{specialValues.zero}}', context)).toBe(0);
|
||||
expect(resolveInput('{{specialValues.booleanFalse}}', context)).toBe(false);
|
||||
expect(resolveInput('{{specialValues.booleanTrue}}', context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return undefined for undefined input', () => {
|
||||
expect(resolveInput(undefined, context)).toBeUndefined();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user