docs/reports/2026-10-05-full-model-comparison/form-tests-unit-tests.log
1bun test v1.4.0 (34cbb9a40)
2
3tests/formDataToObject.test.ts:
4(pass) formDataToObject > maps single key/value pairs 1:1 [0.19ms]
5(pass) formDataToObject > collapses two values for the same key into an array [0.02ms]
6(pass) formDataToObject > extends an existing array with subsequent values [0.01ms]
7(pass) formDataToObject > normalizes bracket-suffixed keys before grouping values
8(pass) formDataToObject > handles empty FormData
9
10tests/prefillForm.test.ts:
11(pass) prefillForm > expands first/last/email to every form-field variant [0.02ms]
12(pass) prefillForm > returns undefined when there is no usable data [0.01ms]
13(pass) prefillForm > skips a missing piece without including it [0.01ms]
14
15tests/formBuilderStepper.test.ts:
16(pass) formBuilderStepper > visible steps skip conditional steps and clamp away from hidden current steps [0.44ms]
17(pass) formBuilderStepper > empty text-only step is valid and hidden controls on other steps do not block it [1.41ms]
18(pass) formBuilderStepper > required inputs and checkbox groups only validate the active step [0.75ms]
19
20tests/validateStepInputs.test.ts:
21(pass) validateStepInputs > empty step with expectedFieldCount=0 is valid [0.02ms]
22(pass) validateStepInputs > empty step but expecting fields is invalid
23(pass) validateStepInputs > required text input without value is invalid [0.15ms]
24(pass) validateStepInputs > required text input with value is valid [0.10ms]
25(pass) validateStepInputs > required email field with invalid format is invalid [0.24ms]
26(pass) validateStepInputs > disabled required input is excluded from validation [0.10ms]
27(pass) validateStepInputs > required checkbox group with only the first checkbox marked required behaves as a group [0.15ms]
28(pass) validateStepInputs > required checkbox group with only the first checkbox marked required is valid when one is checked [0.13ms]
29(pass) validateStepInputs > mixed: invalid required text + valid optional select returns the text input [0.51ms]
30
31tests/getFormFieldOptions.test.ts:
32(pass) getFormFieldOptions > uses the preset list when it has options [0.03ms]
33(pass) getFormFieldOptions > falls back to manual options when no preset is set [0.02ms]
34(pass) getFormFieldOptions > returns [] when neither preset nor manual options exist
35(pass) getFormFieldOptions > defaults value to label when value is missing
36
37tests/hiddenFieldValue.test.ts:
38(pass) hidden field helpers > resolves hidden step field values from the field name query param when present [0.03ms]
39(pass) hidden field helpers > falls back to the hidden step field value when the query param is missing
40(pass) hidden field helpers > preserves an explicitly empty query param value
41(pass) hidden field helpers > resolves form-level hidden fields from query params [0.02ms]
42(pass) hidden field helpers > uses the fallback when a form-level query param is missing
43(pass) hidden field helpers > legacy raw hidden input resolution still resolves query params from the raw value
44
45tests/guestRegistrationPayload.test.ts:
46(pass) normalizeFormDataToGuestPayload > picks the first non-empty value across name/email/role aliases [0.05ms]
47(pass) normalizeFormDataToGuestPayload > uses index 0 for array values (current behavior — empty first entry is ignored)
48(pass) normalizeFormDataToGuestPayload > omits fields entirely when no alias produced a value
49(pass) guestPayloadToFormPrefill > expands payload to every known form field variant [0.02ms]
50(pass) guestPayloadToFormPrefill > returns {} for null or empty payload
51(pass) buildGuestRegistrationCookieValue > produces a Set-Cookie string with the correct attrs and URL-encoded JSON value [0.05ms]
52
53tests/formStorage.test.ts:
54(pass) form-storage > save + load roundtrips the field values [0.18ms]
55(pass) form-storage > load returns null when there is nothing stored
56(pass) form-storage > clear removes the stored data [0.02ms]
57(pass) form-storage > expired local data is removed [0.02ms]
58(pass) form-storage > migrates legacy session data to localStorage [0.02ms]
59(pass) form-storage > discards malformed local data [0.02ms]
60(pass) form-storage > storage key namespaces by formId
61
62tests/expandStepMembers.test.ts:
63(pass) expandStepMembers — per-member field-set condition > inherits the wrapper condition on inner members that have no condition of their own [0.13ms]
64(pass) expandStepMembers — per-member field-set condition > honors a per-member condition when set, overriding the wrapper (legacy `mergeWrapperConditionals` parity) [0.01ms]
65(pass) expandStepMembers — per-member field-set condition > emits no condition when neither the wrapper nor the member declares one [0.01ms]
66(pass) expandStepMembers — per-member field-set condition > resolves repeated same field ids to the nearest previous rendered member at runtime [0.05ms]
67(pass) expandStepMembers — per-member field-set condition > namespaces field-set member runtime ids per wrapper instance [0.06ms]
68(pass) expandStepMembers — terms variant on rich text only > default tcVersion shows default rich text and checkbox [0.08ms]
69(pass) expandStepMembers — terms variant on rich text only > sponsored tcVersion shows sponsored rich text and same checkbox [0.09ms]
70
71tests/formBuilderConditions.test.ts:
72(pass) evaluateFormBuilderCondition > returns true when condition is undefined
73(pass) evaluateFormBuilderCondition > returns false when dependency field id is missing from fields map
74(pass) evaluateFormBuilderCondition > matches equals on string value
75(pass) evaluateFormBuilderCondition > matches equals on checkbox array value
76(pass) evaluateFormBuilderCondition > supports is not in the value-map fallback path [0.02ms]
77(pass) evaluateFormBuilderCondition > is not stays false when the value-map source is empty
78(pass) evaluateFormBuilderCondition > empty equals means any non-empty value
7964 | this[PropertySymbol.ownerDocument] = this[PropertySymbol.window].document;
8065 | }
8166 | else {
8267 | const ownerDocument = NodeFactory.pullOwnerDocument();
8368 | if (!ownerDocument) {
8469 | throw new TypeError('Illegal constructor');
85 ^
86TypeError: Illegal constructor
87 at new Node (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/node/Node.js:69:58)
88 at new Element (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/element/Element.js:89:9)
89 at new HTMLElement (1:23)
90 at new HTMLInputElement (1:23)
91 at createMockInput (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:52:16)
92 at <anonymous> (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:153:5)
93(fail) evaluateFormBuilderCondition > supports is not in the DOM-backed path [0.19ms]
9464 | this[PropertySymbol.ownerDocument] = this[PropertySymbol.window].document;
9565 | }
9666 | else {
9767 | const ownerDocument = NodeFactory.pullOwnerDocument();
9868 | if (!ownerDocument) {
9969 | throw new TypeError('Illegal constructor');
100 ^
101TypeError: Illegal constructor
102 at new Node (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/node/Node.js:69:58)
103 at new Element (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/element/Element.js:89:9)
104 at new HTMLElement (1:23)
105 at new HTMLInputElement (1:23)
106 at createMockInput (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:52:16)
107 at <anonymous> (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:189:5)
108(fail) evaluateFormBuilderCondition > is not stays false when the DOM-backed source is empty [0.05ms]
10964 | this[PropertySymbol.ownerDocument] = this[PropertySymbol.window].document;
11065 | }
11166 | else {
11267 | const ownerDocument = NodeFactory.pullOwnerDocument();
11368 | if (!ownerDocument) {
11469 | throw new TypeError('Illegal constructor');
115 ^
116TypeError: Illegal constructor
117 at new Node (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/node/Node.js:69:58)
118 at new Element (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/element/Element.js:89:9)
119 at new HTMLElement (1:23)
120 at new HTMLInputElement (1:23)
121 at createMockInput (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:52:16)
122 at <anonymous> (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:211:5)
123(fail) evaluateFormBuilderCondition > keeps any-value behavior when equals is blank in the DOM-backed path [0.06ms]
12464 | this[PropertySymbol.ownerDocument] = this[PropertySymbol.window].document;
12565 | }
12666 | else {
12767 | const ownerDocument = NodeFactory.pullOwnerDocument();
12868 | if (!ownerDocument) {
12969 | throw new TypeError('Illegal constructor');
130 ^
131TypeError: Illegal constructor
132 at new Node (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/node/Node.js:69:58)
133 at new Element (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/element/Element.js:89:9)
134 at new HTMLElement (1:23)
135 at new HTMLInputElement (1:23)
136 at createMockInput (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:52:16)
137 at <anonymous> (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:251:5)
138(fail) evaluateFormBuilderCondition > prefers the field id over same-name DOM matches [0.04ms]
13964 | this[PropertySymbol.ownerDocument] = this[PropertySymbol.window].document;
14065 | }
14166 | else {
14267 | const ownerDocument = NodeFactory.pullOwnerDocument();
14368 | if (!ownerDocument) {
14469 | throw new TypeError('Illegal constructor');
145 ^
146TypeError: Illegal constructor
147 at new Node (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/node/Node.js:69:58)
148 at new Element (/Users/federico/ws/unleash-ai/node_modules/.pnpm/happy-dom@15.11.7/node_modules/happy-dom/lib/nodes/element/Element.js:89:9)
149 at new HTMLElement (1:23)
150 at new HTMLInputElement (1:23)
151 at createMockInput (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:52:16)
152 at <anonymous> (/Users/federico/.codex/worktrees/ai-model-uat-openai/unleash-ai/packages/form-tests/tests/formBuilderConditions.test.ts:274:5)
153(fail) evaluateFormBuilderCondition > does not fall back to same-name fields when sourceMemberId is provided but missing [0.04ms]
154
155tests/validateTermsCheckboxes.test.ts:
156(pass) validateTermsCheckboxes > returns true when there are no required terms checkboxes [0.32ms]
157(pass) validateTermsCheckboxes > returns true when optional terms checkboxes are unchecked [0.15ms]
158(pass) validateTermsCheckboxes > returns false when a required terms checkbox is unchecked [0.10ms]
159(pass) validateTermsCheckboxes > returns true when every required terms checkbox is checked [0.18ms]
160(pass) validateTermsCheckboxes > returns false if even one required terms checkbox is unchecked [0.18ms]
161(pass) validateTermsCheckboxes > ignores non-terms required checkboxes [0.05ms]
162
163tests/expandStepFieldItems.test.ts:
164(pass) expandStepFieldItems > returns plain field types untouched, assigning a fallback conditionalId [0.17ms]
165(pass) expandStepFieldItems > preserves an authored conditionalId verbatim (does not override) [0.02ms]
166(pass) expandStepFieldItems > normalizes `preset*` _types to runtime types when used inside a fieldset [0.03ms]
167(pass) expandStepFieldItems > top-level bare preset field is dropped (must be wrapped in fieldset or fieldPresetConditional)
168(pass) expandStepFieldItems > flattens a fieldset row into its children [0.03ms]
169(pass) expandStepFieldItems > resolves same-name field dependencies within each fieldset instance [0.08ms]
170(pass) expandStepFieldItems > resolves repeated same-name dependencies to the nearest previous sibling in one scope [0.03ms]
171(pass) expandStepFieldItems > fieldsetConditional propagates wrapper conditional onto children that have none [0.04ms]
172(pass) expandStepFieldItems > fieldsetConditional namespaces inner conditionalId with the wrapper key [0.02ms]
173(pass) expandStepFieldItems > does NOT overwrite a child conditional when the child already has one [0.01ms]
174(pass) expandStepFieldItems > fieldPresetConditional expands inner field and normalizes preset _type [0.01ms]
175(pass) expandStepFieldItems > resolves sibling name dependency to conditionalId inside a fieldset [0.02ms]
176(pass) expandStepFieldItems > drops unknown row types without throwing
177
178tests/isConditionalDependencyMet.test.ts:
179(pass) isConditionalDependencyMet > returns true when no dependency is specified [0.20ms]
180(pass) isConditionalDependencyMet > prefers explicit conditional id over same-name matches [0.16ms]
181(pass) isConditionalDependencyMet > returns false when dependency is specified but form is missing
182(pass) isConditionalDependencyMet > matches by explicit conditional id when the dependency has a value [0.07ms]
183(pass) isConditionalDependencyMet > returns false when an explicit id is given but no matching element exists (no name fallback) [0.04ms]
184(pass) isConditionalDependencyMet > uses name fallback when requiresOtherFieldId starts with `name:` [0.05ms]
185(pass) isConditionalDependencyMet > uses name fallback when only requiresOtherField is supplied (legacy) [0.04ms]
186(pass) isConditionalDependencyMet > requiresOtherFieldValue must match exactly [0.06ms]
187(pass) isConditionalDependencyMet > checkbox dependency requires the matching value to be checked [0.09ms]
188(pass) isConditionalDependencyMet > hidden inputs satisfy dependency when their value matches [0.06ms]
189(pass) isConditionalDependencyMet > presence-only dependency is unmet when the dependency value is empty [0.05ms]
190
191tests/fieldLabels.test.ts:
192(pass) field labels > nav labels prefer the authored field ID/name [0.01ms]
193(pass) field labels > sidebar labels stay human-friendly for editing surfaces [0.02ms]
194
1955 tests failed:
196(fail) evaluateFormBuilderCondition > supports is not in the DOM-backed path [0.19ms]
197(fail) evaluateFormBuilderCondition > is not stays false when the DOM-backed source is empty [0.05ms]
198(fail) evaluateFormBuilderCondition > keeps any-value behavior when equals is blank in the DOM-backed path [0.06ms]
199(fail) evaluateFormBuilderCondition > prefers the field id over same-name DOM matches [0.04ms]
200(fail) evaluateFormBuilderCondition > does not fall back to same-name fields when sourceMemberId is provided but missing [0.04ms]
201
202 89 pass
203 5 fail
204 153 expect() calls
205Ran 94 tests across 14 files. [105.00ms]
206