chore(Form Node): Add dropdown example (#18809)

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
yehorkardash
2025-09-05 09:09:00 +03:00
committed by GitHub
parent 3175650a7a
commit 6456b7c07d
4 changed files with 24 additions and 4 deletions

View File

@@ -1,6 +1,11 @@
import { DateTime, Settings } from 'luxon';
import { getValueDescription, tryToParseDateTime, validateFieldType } from '../src/type-validation';
import {
getValueDescription,
tryToParseDateTime,
tryToParseJsonToFormFields,
validateFieldType,
} from '../src/type-validation';
describe('Type Validation', () => {
describe('string-alphanumeric', () => {
@@ -359,4 +364,12 @@ describe('Type Validation', () => {
expect(result.toISO()).toEqual('2025-01-01T00:00:00.000+09:00');
});
});
describe('tryToParseJsonToFormFields', () => {
it('should parse html field', () => {
const json = '[{"fieldType": "html", "html": "<div>test</div>"}]';
const fields = tryToParseJsonToFormFields(json);
expect(fields).toEqual([{ fieldType: 'html', html: '<div>test</div>' }]);
});
});
});