chore(n8n Form Node): Incorporate design feedback for Custom HTML (#12817)

This commit is contained in:
Dana
2025-02-04 18:03:19 +01:00
committed by GitHub
parent b60011a180
commit ddc40ef7de
6 changed files with 106 additions and 24 deletions

View File

@@ -743,6 +743,22 @@ describe('prepareFormReturnItem', () => {
expect(result.json.formQueryParameters).toEqual(staticData);
});
it('should return html if field name is set', async () => {
mockContext.getBodyData.mockReturnValue({
data: { 'field-0': '<div>hi</div>', 'field-1': '<h1><haha/hi>' },
files: {},
});
const formFields = [
{ fieldLabel: '', elementName: 'greeting', fieldType: 'html' },
{ fieldLabel: '', elementName: '', fieldType: 'html' },
];
const result = await prepareFormReturnItem(mockContext, formFields, 'production');
expect(result.json.greeting).toBe('<div>hi</div>');
expect(result.json.formMode).toBe('production');
});
});
describe('resolveRawData', () => {