mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
chore(n8n Form Node): Incorporate design feedback for Custom HTML (#12817)
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user