diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Button.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Button.spec.js index 53f51c0e0..a5db6456b 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Button.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Button.spec.js @@ -106,7 +106,7 @@ describe('Button', function () { // assume const { config } = Button; expect(config.type).to.eql('button'); - expect(config.label).to.eql('Button'); + expect(config.name).to.eql('Button'); expect(config.group).to.eql('action'); expect(config.keyed).to.be.false; @@ -115,6 +115,7 @@ describe('Button', function () { // then expect(field).to.eql({ + label: 'Button', action: 'submit', }); diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Checkbox.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Checkbox.spec.js index 734a62478..29aecdcc8 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Checkbox.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Checkbox.spec.js @@ -153,7 +153,7 @@ describe('Checkbox', function () { // assume const { config } = Checkbox; expect(config.type).to.eql('checkbox'); - expect(config.label).to.eql('Checkbox'); + expect(config.name).to.eql('Checkbox'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; @@ -161,7 +161,9 @@ describe('Checkbox', function () { const field = config.create(); // then - expect(field).to.eql({}); + expect(field).to.eql({ + label: 'Checkbox', + }); // but when const customField = config.create({ diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Checklist.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Checklist.spec.js index f6a9019f0..c0d0a3743 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Checklist.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Checklist.spec.js @@ -414,7 +414,7 @@ describe('Checklist', function () { // assume const { config } = Checklist; expect(config.type).to.eql('checklist'); - expect(config.label).to.eql('Checkbox group'); + expect(config.name).to.eql('Checkbox group'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; @@ -423,6 +423,7 @@ describe('Checklist', function () { // then expect(field).to.eql({ + label: 'Checkbox group', values: [ { label: 'Value', diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Datetime.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Datetime.spec.js index bd7d40d68..3d1365a80 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Datetime.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Datetime.spec.js @@ -895,7 +895,7 @@ describe('Datetime', function () { expect(config.keyed).to.be.true; // when - const field = config.create(); + const field = config.create({}, true); // then expect(field).to.eql({ @@ -903,6 +903,22 @@ describe('Datetime', function () { dateLabel: 'Date', }); + // but when + const timeField = config.create({ + subtype: 'time', + timeLabel: 'Time', + timeSerializingFormat: 'no_timezone', + timeInterval: 15, + }); + + // then + expect(timeField).to.eql({ + subtype: 'time', + timeLabel: 'Time', + timeSerializingFormat: 'no_timezone', + timeInterval: 15, + }); + // but when const customField = config.create({ custom: true, diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Dynamiclist.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Dynamiclist.spec.js index ada0e073b..9ca458307 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Dynamiclist.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Dynamiclist.spec.js @@ -234,11 +234,13 @@ describe('Dynamic List', () => { // then expect(config.type).to.eql('dynamiclist'); + expect(config.name).to.eql('Dynamic list'); expect(config.repeatable).to.be.true; expect(config.pathed).to.be.true; const field = config.create(); expect(field).to.eql({ + label: 'Dynamic list', components: [], showOutline: true, isRepeating: true, diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Group.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Group.spec.js index 10a56cdbe..094906dc8 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Group.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Group.spec.js @@ -103,7 +103,7 @@ describe('Group', () => { // assume const { config } = Group; expect(config.type).to.eql('group'); - expect(config.label).to.eql('Group'); + expect(config.name).to.eql('Group'); expect(config.group).to.eql('container'); expect(config.pathed).to.be.true; @@ -112,6 +112,7 @@ describe('Group', () => { // then expect(field).to.eql({ + label: 'Group', components: [], showOutline: true, }); diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/IFrame.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/IFrame.spec.js index cd1ac4848..23fbc0d5a 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/IFrame.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/IFrame.spec.js @@ -229,7 +229,7 @@ describe('IFrame', function () { // assume const { config } = IFrame; expect(config.type).to.eql('iframe'); - expect(config.label).to.eql('iFrame'); + expect(config.name).to.eql('iFrame'); expect(config.group).to.eql('container'); expect(config.keyed).to.be.false; @@ -237,7 +237,12 @@ describe('IFrame', function () { const field = config.create(); // then - expect(field).to.exist; + expect(field).to.eql({ + label: 'iFrame', + security: { + allowScripts: true, + }, + }); // but when const customField = config.create({ diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Image.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Image.spec.js index ce5215ba8..d23206d48 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Image.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Image.spec.js @@ -217,7 +217,7 @@ describe('Image', function () { // assume const { config } = Image; expect(config.type).to.eql('image'); - expect(config.label).to.eql('Image view'); + expect(config.name).to.eql('Image view'); expect(config.group).to.eql('presentation'); expect(config.keyed).to.be.false; @@ -225,7 +225,7 @@ describe('Image', function () { const field = config.create(); // then - expect(field).to.exist; + expect(field).to.eql({}); // but when const customField = config.create({ diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Number.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Number.spec.js index 34f0659ea..884f3a299 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Number.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Number.spec.js @@ -769,7 +769,7 @@ describe('Number', function () { // assume const { config } = Numberfield; expect(config.type).to.eql('number'); - expect(config.label).to.eql('Number'); + expect(config.name).to.eql('Number'); expect(config.group).to.eql('basic-input'); expect(config.keyed).to.be.true; @@ -777,7 +777,9 @@ describe('Number', function () { const field = config.create(); // then - expect(field).to.eql({}); + expect(field).to.eql({ + label: 'Number', + }); // but when const customField = config.create({ diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Radio.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Radio.spec.js index 2f1834f47..eee5baf7b 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Radio.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Radio.spec.js @@ -272,7 +272,7 @@ describe('Radio', function () { // assume const { config } = Radio; expect(config.type).to.eql('radio'); - expect(config.label).to.eql('Radio group'); + expect(config.name).to.eql('Radio group'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; @@ -281,6 +281,7 @@ describe('Radio', function () { // then expect(field).to.eql({ + label: 'Radio group', values: [ { label: 'Value', diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Select.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Select.spec.js index c9f85f2f9..0e2938715 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Select.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Select.spec.js @@ -892,7 +892,7 @@ describe('Select', function () { // assume const { config } = Select; expect(config.type).to.eql('select'); - expect(config.label).to.eql('Select'); + expect(config.name).to.eql('Select'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; @@ -901,6 +901,7 @@ describe('Select', function () { // then expect(field).to.eql({ + label: 'Select', values: [ { label: 'Value', @@ -924,7 +925,7 @@ describe('Select', function () { // assume const { config } = Select; expect(config.type).to.eql('select'); - expect(config.label).to.eql('Select'); + expect(config.name).to.eql('Select'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; @@ -950,7 +951,7 @@ describe('Select', function () { // assume const { config } = Select; expect(config.type).to.eql('select'); - expect(config.label).to.eql('Select'); + expect(config.name).to.eql('Select'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Table.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Table.spec.js index e262b2399..3538823c3 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Table.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Table.spec.js @@ -6,6 +6,7 @@ import { Table } from '../../../../../src/render/components/form-fields/Table'; import { createFormContainer, expectNoViolations } from '../../../../TestHelper'; import { MockFormContext } from '../helper'; +import { expect } from 'chai'; let container; @@ -433,7 +434,7 @@ describe('Table', function () { // assume const { config } = Table; expect(config.type).to.eql('table'); - expect(config.label).to.eql('Table'); + expect(config.name).to.eql('Table'); expect(config.group).to.eql('presentation'); expect(config.keyed).to.be.false; @@ -442,6 +443,7 @@ describe('Table', function () { // then expect(field).to.exist; + expect(field.label).to.eql('Table'); // but when const customField = config.create({ diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Taglist.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Taglist.spec.js index 7dce1cf84..1407cade2 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Taglist.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Taglist.spec.js @@ -684,7 +684,7 @@ describe('Taglist', function () { // assume const { config } = Taglist; expect(config.type).to.eql('taglist'); - expect(config.label).to.eql('Tag list'); + expect(config.name).to.eql('Tag list'); expect(config.group).to.eql('selection'); expect(config.keyed).to.be.true; @@ -693,6 +693,7 @@ describe('Taglist', function () { // then expect(field).to.eql({ + label: 'Tag list', values: [ { label: 'Value', diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Text.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Text.spec.js index 5c11cddbc..3ab7ae4b4 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Text.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Text.spec.js @@ -262,7 +262,7 @@ Some _em_ **strong** [text](#text) \`code\`. // assume const { config } = Text; expect(config.type).to.eql('text'); - expect(config.label).to.eql('Text view'); + expect(config.name).to.eql('Text view'); expect(config.group).to.eql('presentation'); expect(config.keyed).to.be.false; diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Textarea.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Textarea.spec.js index d1697cb56..db0f84583 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Textarea.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Textarea.spec.js @@ -208,7 +208,7 @@ describe('Textarea', function () { // assume const { config } = Textarea; expect(config.type).to.eql('textarea'); - expect(config.label).to.eql('Text area'); + expect(config.name).to.eql('Text area'); expect(config.group).to.eql('basic-input'); expect(config.keyed).to.be.true; @@ -216,7 +216,9 @@ describe('Textarea', function () { const field = config.create(); // then - expect(field).to.eql({}); + expect(field).to.eql({ + label: 'Text area', + }); // but when const customField = config.create({ diff --git a/packages/form-js-viewer/test/spec/render/components/form-fields/Textfield.spec.js b/packages/form-js-viewer/test/spec/render/components/form-fields/Textfield.spec.js index d8ed8ff96..21e0249bd 100644 --- a/packages/form-js-viewer/test/spec/render/components/form-fields/Textfield.spec.js +++ b/packages/form-js-viewer/test/spec/render/components/form-fields/Textfield.spec.js @@ -349,7 +349,7 @@ describe('Textfield', function () { // assume const { config } = Textfield; expect(config.type).to.eql('textfield'); - expect(config.label).to.eql('Text field'); + expect(config.name).to.eql('Text field'); expect(config.group).to.eql('basic-input'); expect(config.keyed).to.be.true; @@ -357,7 +357,9 @@ describe('Textfield', function () { const field = config.create(); // then - expect(field).to.eql({}); + expect(field).to.eql({ + label: 'Text field', + }); // but when const customField = config.create({