Skip to main content

Variable: fixtures

const fixtures: object;

Defined in: packages/testing/src/fixtures.ts:84

Type Declaration

calculated()

calculated(opts?): FormDefinition;

A calculate field, which must reject user writes (docs/04, ODK parity).

Parameters

ParameterType
optsBaseOptions

Returns

FormDefinition

consentGated()

consentGated(opts?): FormDefinition;

Consent gating: everything after the consent question is irrelevant until it is answered yes. This is the shape almost every humanitarian form opens with, and the one where ODK's "relevance clears on finalize" rule actually bites (docs/04).

Parameters

ParameterType
optsBaseOptions

Returns

FormDefinition

fromJson()

fromJson(json, opts?): FormDefinition;

Load a definition a host already has — the two agency examples in docs/examples/, or its own form.

Validates by default, because a fixture that is silently invalid turns every test written against it into a test of the wrong thing. Pass { validate: false } when the invalid document IS the fixture.

Parameters

ParameterType
jsonunknown
opts{ validate?: boolean; }
opts.validate?boolean

Returns

FormDefinition

large()

large(opts?): FormDefinition;

A form sized for the performance budgets in docs/05 §perf (300 questions, full recompute < 16 ms on the reference device).

Parameters

ParameterType
optsLargeFormOptions

Returns

FormDefinition

minimal()

minimal(opts?): FormDefinition;

One page, one required text field. The smallest thing that can fail.

Parameters

ParameterType
optsBaseOptions

Returns

FormDefinition

multiPage()

multiPage(opts?): FormDefinition;

Three pages, the middle one gated — for paging and skip-logic tests.

Parameters

ParameterType
optsBaseOptions

Returns

FormDefinition

repeats()

repeats(opts?): FormDefinition;

A count-driven repeat next to a manual one. The count-driven repeat must refuse a manual add — an ODK semantic the engine enforces and hosts routinely get wrong when they build their own repeat UI.

Parameters

ParameterType
optsBaseOptions

Returns

FormDefinition

validation()

validation(opts?): FormDefinition;

Required, constraint, and a warning-severity validator on one page.

Parameters

ParameterType
optsBaseOptions

Returns

FormDefinition