pict-section-form 1.3.13 → 1.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/Injection_Conformance.md +137 -0
- package/docs/_sidebar.md +1 -0
- package/docs/input_providers/012-tab-group-selector.md +3 -1
- package/docs/input_providers/013-tab-section-selector.md +3 -1
- package/package.json +6 -5
- package/source/providers/Pict-Provider-DynamicFormSolverBehaviors.js +73 -5
- package/source/providers/Pict-Provider-DynamicSolver.js +20 -2
- package/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.js +42 -3
- package/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.js +42 -3
- package/source/views/Pict-View-Form-Metacontroller.js +685 -90
- package/test/Pict-Provider-DynamicFormSolverBehaviors-OrdinalScope_tests.js +105 -0
- package/test/Pict-Provider-Input-TabGroupSelector-TabHashValidation_tests.js +178 -0
- package/test/Pict-Provider-Input-TabSectionSelector-TabHashValidation_tests.js +193 -0
- package/test/Pict-View-Form-Metacontroller-DistinctManifest_tests.js +410 -0
- package/test/PictSectionForm-Injection-Conformance_tests.js +751 -0
- package/test/browser/Injection-Conformance-Differential-Scenario.js +346 -0
- package/test/browser/Injection-Conformance-EdgeCase-Scenario.js +168 -0
- package/test/browser/Injection-Conformance-Harness-Driver.js +538 -0
- package/test/browser/Injection-Conformance-Harness-Runner.js +487 -0
- package/test/browser/Injection-Conformance-Reconstitution-Scenario.js +191 -0
- package/test/browser/Injection-Conformance-Standalone-Scenario.js +114 -0
- package/test/fixtures/injection/Injection-Fixture-Cases.js +203 -0
- package/test/fixtures/injection/Injection-Fixture-Manifest.json +366 -0
- package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts +110 -1
- package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts.map +1 -1
- package/types/source/providers/Pict-Provider-DynamicSolver.d.ts.map +1 -1
- package/types/source/providers/Pict-Provider-DynamicTabularData.d.ts +17 -1
- package/types/source/providers/Pict-Provider-DynamicTabularData.d.ts.map +1 -1
- package/types/source/providers/Pict-Provider-InputExtension.d.ts +31 -0
- package/types/source/providers/Pict-Provider-InputExtension.d.ts.map +1 -1
- package/types/source/providers/inputs/Pict-Provider-Input-Chart-CSS.d.ts +16 -0
- package/types/source/providers/inputs/Pict-Provider-Input-Chart-CSS.d.ts.map +1 -0
- package/types/source/providers/inputs/Pict-Provider-Input-Chart.d.ts +47 -0
- package/types/source/providers/inputs/Pict-Provider-Input-Chart.d.ts.map +1 -1
- package/types/source/providers/inputs/Pict-Provider-Input-Diagram.d.ts +86 -0
- package/types/source/providers/inputs/Pict-Provider-Input-Diagram.d.ts.map +1 -1
- package/types/source/providers/inputs/Pict-Provider-Input-ObjectEditor.d.ts +128 -0
- package/types/source/providers/inputs/Pict-Provider-Input-ObjectEditor.d.ts.map +1 -0
- package/types/source/providers/inputs/Pict-Provider-Input-PreciseNumber.d.ts.map +1 -1
- package/types/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.d.ts +10 -1
- package/types/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.d.ts.map +1 -1
- package/types/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.d.ts +10 -1
- package/types/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.d.ts.map +1 -1
- package/types/source/providers/layouts/Pict-Layout-Tabular.d.ts +76 -4
- package/types/source/providers/layouts/Pict-Layout-Tabular.d.ts.map +1 -1
- package/types/source/views/Pict-View-DynamicForm.d.ts.map +1 -1
- package/types/source/views/Pict-View-Form-Metacontroller.d.ts +63 -2
- package/types/source/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Standalone scenario: boots a manifest as the form itself (no injection), seeds data, solves and reports
|
|
3
|
+
the resulting data, hidden sections and any `Expect` mismatches. For checking solver behavior of a
|
|
4
|
+
manifest outside a host form.
|
|
5
|
+
|
|
6
|
+
Config: { Scenario: 'Standalone', Manifest, MarshalDestination?, Data?, Fill?: { Seed, RowCount }, Expect?: { address: value } }
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const libDifferential = require('./Injection-Conformance-Differential-Scenario.js');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {any} pValue
|
|
13
|
+
* @return {any}
|
|
14
|
+
*/
|
|
15
|
+
function cloneData(pValue)
|
|
16
|
+
{
|
|
17
|
+
return (pValue === undefined) ? undefined : JSON.parse(JSON.stringify(pValue));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Evaluates the expectations a caller configured.
|
|
22
|
+
*
|
|
23
|
+
* `Expect` is either an address to value map, or an array of entries:
|
|
24
|
+
* { Kind: 'Value', Address, Value }
|
|
25
|
+
* { Kind: 'SectionVisible', Section, Visible }
|
|
26
|
+
* { Kind: 'GroupVisible', Section, Group, Visible }
|
|
27
|
+
*
|
|
28
|
+
* @param {import('./Injection-Conformance-Harness-Driver.js').HarnessContext} pContext
|
|
29
|
+
* @param {any} pExpect
|
|
30
|
+
*/
|
|
31
|
+
function checkExpectations(pContext, pExpect)
|
|
32
|
+
{
|
|
33
|
+
if (!pExpect)
|
|
34
|
+
{
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!Array.isArray(pExpect))
|
|
38
|
+
{
|
|
39
|
+
for (const [ tmpAddress, tmpExpected ] of Object.entries(pExpect))
|
|
40
|
+
{
|
|
41
|
+
pContext.checkEqual(`${tmpAddress} = ${JSON.stringify(tmpExpected)}`, pContext.getValue(tmpAddress), tmpExpected);
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
for (const tmpExpectation of pExpect)
|
|
46
|
+
{
|
|
47
|
+
if (!tmpExpectation || (typeof(tmpExpectation) !== 'object'))
|
|
48
|
+
{
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
switch (tmpExpectation.Kind)
|
|
52
|
+
{
|
|
53
|
+
case 'SectionVisible':
|
|
54
|
+
pContext.checkEqual(`section ${tmpExpectation.Section} is ${tmpExpectation.Visible ? 'visible' : 'hidden'}`, pContext.isSectionHidden(tmpExpectation.Section), !tmpExpectation.Visible);
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
case 'GroupVisible':
|
|
58
|
+
pContext.checkEqual(`group ${tmpExpectation.Section}/${tmpExpectation.Group} is ${tmpExpectation.Visible ? 'visible' : 'hidden'}`, pContext.isGroupHidden(tmpExpectation.Section, tmpExpectation.Group), !tmpExpectation.Visible);
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case 'Value':
|
|
62
|
+
default:
|
|
63
|
+
pContext.checkEqual(`${tmpExpectation.Address} = ${JSON.stringify(tmpExpectation.Value)}`, pContext.getValue(tmpExpectation.Address), tmpExpectation.Value);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {import('./Injection-Conformance-Harness-Driver.js').HarnessContext} pContext
|
|
71
|
+
* @return {Promise<void>}
|
|
72
|
+
*/
|
|
73
|
+
async function run(pContext)
|
|
74
|
+
{
|
|
75
|
+
const tmpConfig = pContext.config;
|
|
76
|
+
const tmpManifest = cloneData(tmpConfig.Manifest);
|
|
77
|
+
if (!tmpManifest.ReferenceManifests)
|
|
78
|
+
{
|
|
79
|
+
tmpManifest.ReferenceManifests = {};
|
|
80
|
+
}
|
|
81
|
+
await pContext.boot({ HostManifest: tmpManifest, MarshalDestination: tmpConfig.MarshalDestination, InitialAppData: tmpConfig.InitialAppData });
|
|
82
|
+
|
|
83
|
+
const tmpMarshal = pContext.marshalDestinationObject;
|
|
84
|
+
if (tmpConfig.Fill)
|
|
85
|
+
{
|
|
86
|
+
for (const [ tmpAddress, tmpValue ] of Object.entries(libDifferential.buildFill(tmpManifest, tmpConfig.Fill)))
|
|
87
|
+
{
|
|
88
|
+
pContext.pict.manifest.setValueAtAddress(tmpMarshal, tmpAddress, tmpValue);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const [ tmpAddress, tmpValue ] of Object.entries(tmpConfig.Data || {}))
|
|
92
|
+
{
|
|
93
|
+
pContext.pict.manifest.setValueAtAddress(tmpMarshal, tmpAddress, cloneData(tmpValue));
|
|
94
|
+
}
|
|
95
|
+
for (const tmpView of pContext.getSectionViews())
|
|
96
|
+
{
|
|
97
|
+
tmpView.render();
|
|
98
|
+
}
|
|
99
|
+
pContext.metacontroller.marshalToView();
|
|
100
|
+
await pContext.wait(20);
|
|
101
|
+
await pContext.solve();
|
|
102
|
+
await pContext.solve();
|
|
103
|
+
|
|
104
|
+
const tmpHidden = {};
|
|
105
|
+
for (const tmpSection of tmpManifest.Sections || [])
|
|
106
|
+
{
|
|
107
|
+
tmpHidden[tmpSection.Hash] = pContext.isSectionHidden(tmpSection.Hash);
|
|
108
|
+
}
|
|
109
|
+
pContext.snapshots.Standalone = { Data: cloneData(tmpMarshal), Hidden: tmpHidden };
|
|
110
|
+
checkExpectations(pContext, tmpConfig.Expect);
|
|
111
|
+
pContext.check('solve completed', true);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
module.exports = { run: run };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The injection conformance fixture: what the fixture manifest covers, and what each copy of it should hold
|
|
3
|
+
once it has been injected, filled in and solved.
|
|
4
|
+
|
|
5
|
+
Both tiers read this file:
|
|
6
|
+
- the data tier (test/PictSectionForm-Injection-Conformance_tests.js, part of `npm test`)
|
|
7
|
+
- the browser tier (test/browser, `npm run test:injection`)
|
|
8
|
+
|
|
9
|
+
Adding an input type to the library means adding a case here; the coverage suite fails until you do, and
|
|
10
|
+
its failure message says so. See docs/Injection_Conformance.md.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const MARSHAL_DESTINATION = 'AppData.Orchard';
|
|
14
|
+
|
|
15
|
+
// Two salts that share a prefix, so a translation that matches on "starts with" rather than on a boundary
|
|
16
|
+
// shows up as one copy reading the other.
|
|
17
|
+
const SALTS = [ 'alpha', 'alphabeta' ];
|
|
18
|
+
|
|
19
|
+
// What the host form holds at the unsalted root under the injected manifest's own names. A copy that reads an
|
|
20
|
+
// unsalted name picks these up; a copy that writes one changes them.
|
|
21
|
+
const ROOT_DECOYS =
|
|
22
|
+
{
|
|
23
|
+
HostRate: 3,
|
|
24
|
+
Width: 1000,
|
|
25
|
+
Height: 1000,
|
|
26
|
+
HeightMax: 1000,
|
|
27
|
+
Qty: 1000,
|
|
28
|
+
Count: 1000,
|
|
29
|
+
Label: 'host label',
|
|
30
|
+
Dims: { Depth: 1000 },
|
|
31
|
+
ShowExtras: 1,
|
|
32
|
+
Readings: [ 1000, 1000, 1000, 1000 ],
|
|
33
|
+
Crate: { Items: [ 0, 0, 0, 0, 0 ] },
|
|
34
|
+
Rows: [ { Qty: 100, Price: 100, Line: 100 }, { Qty: 100, Price: 100, Line: 100 }, { Qty: 100, Price: 100, Line: 100 } ],
|
|
35
|
+
QtyList: [ 1000 ],
|
|
36
|
+
Source: 1000,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const COPIES =
|
|
40
|
+
{
|
|
41
|
+
alpha:
|
|
42
|
+
{
|
|
43
|
+
Seeded:
|
|
44
|
+
{
|
|
45
|
+
HeightMax: 10, Qty: 7, Dims: { Depth: 2 }, ShowExtras: 0, Readings: [ 9, 8, 7 ], Crate: { Items: [ 1, 2, 3 ] },
|
|
46
|
+
Rows: [ { Qty: 2, Price: 3 }, { Qty: 4, Price: 5 } ], Count: 3,
|
|
47
|
+
},
|
|
48
|
+
Entered: { Width: 4, Height: 5 },
|
|
49
|
+
Expected:
|
|
50
|
+
{
|
|
51
|
+
Area: 20, AreaScaled: 60, RowCount: 2, FirstLine: 6, LineTotal: 26, SecondLine: 20, SecondQty: 4, WidthCopy: 4,
|
|
52
|
+
ReadingCount: 3, FirstReading: 9, ItemCount: 3, Volume: 40, QtyList: [ 2, 4 ], Doubled: [ 4, 8 ], Scaled: [ 8, 16 ],
|
|
53
|
+
Steps: [ 4, 8 ], RowCarry: [ 0, 4 ], WideLabel: 'Width', HeightMaxPlus: 15,
|
|
54
|
+
},
|
|
55
|
+
Lines: [ 6, 20 ],
|
|
56
|
+
Chart: { Labels: [ 2, 4 ], Line: [ 6, 20 ], Scaled: [ 8, 16 ] },
|
|
57
|
+
Summary: '4x5',
|
|
58
|
+
ExtrasHidden: true,
|
|
59
|
+
FromScratch: 10,
|
|
60
|
+
},
|
|
61
|
+
alphabeta:
|
|
62
|
+
{
|
|
63
|
+
Seeded:
|
|
64
|
+
{
|
|
65
|
+
HeightMax: 20, Qty: 11, Dims: { Depth: 3 }, ShowExtras: 1, Readings: [ 5 ], Crate: { Items: [ 1 ] },
|
|
66
|
+
Rows: [ { Qty: 1, Price: 1 }, { Qty: 3, Price: 2 } ], Count: 8, Source: 2,
|
|
67
|
+
},
|
|
68
|
+
Entered: { Width: 3, Height: 1 },
|
|
69
|
+
Expected:
|
|
70
|
+
{
|
|
71
|
+
Area: 3, AreaScaled: 9, RowCount: 2, FirstLine: 1, LineTotal: 7, SecondLine: 6, SecondQty: 3, WidthCopy: 3,
|
|
72
|
+
ReadingCount: 1, FirstReading: 5, ItemCount: 1, Volume: 9, QtyList: [ 1, 3 ], Doubled: [ 2, 6 ], Scaled: [ 3, 9 ],
|
|
73
|
+
Steps: [ 3, 6 ], RowCarry: [ 0, 2 ], WideLabel: 'Narrow', HeightMaxPlus: 21,
|
|
74
|
+
},
|
|
75
|
+
Lines: [ 1, 6 ],
|
|
76
|
+
Chart: { Labels: [ 1, 3 ], Line: [ 1, 6 ], Scaled: [ 3, 9 ] },
|
|
77
|
+
Summary: '3x1',
|
|
78
|
+
ExtrasHidden: false,
|
|
79
|
+
FromScratch: 8,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @typedef {Object} InjectionInputCase
|
|
85
|
+
* @property {string} Registry - 'InputType:<name>' for a type the metatemplates dispatch on, 'Provider:<name>' for an input provider an input opts into.
|
|
86
|
+
* @property {string} Hash - The fixture descriptor's unsalted hash.
|
|
87
|
+
* @property {'data'|'browser'|'expression'} Tier - Where this case's round trip is asserted: 'data' in the always-on tier, 'browser' in the browser tier, 'expression' only as salted configuration.
|
|
88
|
+
* @property {boolean} Marshals - Whether marshalled data reaches the rendered control.
|
|
89
|
+
* @property {boolean} Accepts - Whether typing into the rendered control reaches the data.
|
|
90
|
+
* @property {any} [Value] - The value the round trip writes.
|
|
91
|
+
* @property {string} [Note] - Why a case is not asserted on the data tier.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/** @type {Array<InjectionInputCase>} */
|
|
95
|
+
const INPUT_CASES =
|
|
96
|
+
[
|
|
97
|
+
{ Registry: 'InputType:String', Hash: 'Label', Tier: 'data', Marshals: true, Accepts: true, Value: 'crate label' },
|
|
98
|
+
{ Registry: 'InputType:Number', Hash: 'Count', Tier: 'data', Marshals: true, Accepts: true, Value: 12 },
|
|
99
|
+
{ Registry: 'InputType:PreciseNumber', Hash: 'Precise', Tier: 'data', Marshals: true, Accepts: true, Value: '3.25' },
|
|
100
|
+
{ Registry: 'InputType:PreciseNumberReadOnly', Hash: 'PreciseDisplay', Tier: 'data', Marshals: true, Accepts: false, Value: '8.50' },
|
|
101
|
+
{ Registry: 'InputType:TextArea', Hash: 'NoteText', Tier: 'data', Marshals: true, Accepts: true, Value: 'a crate note' },
|
|
102
|
+
{ Registry: 'InputType:Boolean', Hash: 'Ready', Tier: 'data', Marshals: true, Accepts: false, Value: true, Note: 'checkbox state is set through the control, not a typed value' },
|
|
103
|
+
{ Registry: 'InputType:Color', Hash: 'Shade', Tier: 'data', Marshals: true, Accepts: true, Value: '#336699' },
|
|
104
|
+
{ Registry: 'InputType:ReadOnly', Hash: 'Reference', Tier: 'data', Marshals: true, Accepts: false, Value: 'read only value' },
|
|
105
|
+
{ Registry: 'InputType:DisplayOnly', Hash: 'Shown', Tier: 'data', Marshals: true, Accepts: false, Value: 'shown value' },
|
|
106
|
+
{ Registry: 'InputType:Hidden', Hash: 'Concealed', Tier: 'data', Marshals: false, Accepts: false, Value: 'concealed value', Note: 'the hidden type renders no control' },
|
|
107
|
+
{ Registry: 'InputType:Markdown', Hash: 'Notes', Tier: 'data', Marshals: true, Accepts: false, Value: '# heading' },
|
|
108
|
+
{ Registry: 'InputType:HTML', Hash: 'Blurb', Tier: 'data', Marshals: true, Accepts: false, Value: '<b>bold</b>' },
|
|
109
|
+
{ Registry: 'InputType:Link', Hash: 'Site', Tier: 'data', Marshals: true, Accepts: false, Value: 'https://example.com/crate' },
|
|
110
|
+
{ Registry: 'InputType:Option', Hash: 'Grade', Tier: 'data', Marshals: true, Accepts: true, Value: 'second' },
|
|
111
|
+
{ Registry: 'InputType:DateTime', Hash: 'Picked', Tier: 'data', Marshals: true, Accepts: true, Value: '2024-03-04T05:06' },
|
|
112
|
+
{ Registry: 'InputType:Templated', Hash: 'Summary', Tier: 'browser', Marshals: true, Accepts: false, Note: 'renders its template against the marshalled data; asserted in the browser tier after a re-render' },
|
|
113
|
+
{ Registry: 'InputType:TemplatedEntityLookup', Hash: 'Lookup', Tier: 'expression', Marshals: false, Accepts: false, Note: 'gathers its entity from a server; only its salted configuration is asserted' },
|
|
114
|
+
{ Registry: 'InputType:Chart', Hash: 'LineChart', Tier: 'browser', Marshals: true, Accepts: false, Note: 'needs a canvas and the charting library' },
|
|
115
|
+
{ Registry: 'InputType:RichText', Hash: 'Story', Tier: 'expression', Marshals: false, Accepts: false, Note: 'needs a real editor surface' },
|
|
116
|
+
{ Registry: 'InputType:Diagram', Hash: 'Sketch', Tier: 'expression', Marshals: false, Accepts: false, Note: 'needs a real drawing surface' },
|
|
117
|
+
{ Registry: 'InputType:ObjectEditor', Hash: 'Payload', Tier: 'expression', Marshals: false, Accepts: false, Note: 'needs a real editor surface' },
|
|
118
|
+
{ Registry: 'InputType:TabSectionSelector', Hash: 'TabPicker', Tier: 'browser', Marshals: true, Accepts: false, Note: 'switching tabs is a DOM interaction across section views' },
|
|
119
|
+
{ Registry: 'InputType:TabGroupSelector', Hash: 'GroupPicker', Tier: 'browser', Marshals: true, Accepts: false, Note: 'switching tabs is a DOM interaction across groups' },
|
|
120
|
+
{ Registry: 'Provider:Pict-Input-AutofillTriggerGroup', Hash: 'Source', Tier: 'browser', Marshals: true, Accepts: true, Value: 6, Note: 'the trigger fires on a real change event' },
|
|
121
|
+
{ Registry: 'Provider:Pict-Input-EntityBundleRequest', Hash: 'Bundled', Tier: 'expression', Marshals: false, Accepts: false, Note: 'gathers its bundle from a server; only its salted configuration is asserted' },
|
|
122
|
+
{ Registry: 'Provider:Pict-Input-TabularTriggerGroup', Hash: 'Tally', Tier: 'expression', Marshals: false, Accepts: false, Note: 'a record set column; its trigger group configuration is asserted on the salted manifest' },
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
// Registry entries with no fixture case, and why. Anything else missing fails the coverage suite.
|
|
126
|
+
const EXCLUDED_REGISTRY_ENTRIES =
|
|
127
|
+
{
|
|
128
|
+
'Provider:Pict-Input-Select': 'exercised through InputType:Option, which dispatches to it',
|
|
129
|
+
'Provider:Pict-Input-PreciseNumber': 'exercised through DataType PreciseNumber and InputType:PreciseNumberReadOnly',
|
|
130
|
+
'Provider:Pict-Input-DateTime': 'exercised through DataType DateTime',
|
|
131
|
+
'Provider:Pict-Input-Link': 'exercised through InputType:Link',
|
|
132
|
+
'Provider:Pict-Input-Markdown': 'exercised through InputType:Markdown',
|
|
133
|
+
'Provider:Pict-Input-HTML': 'exercised through InputType:HTML',
|
|
134
|
+
'Provider:Pict-Input-Chart': 'exercised through InputType:Chart',
|
|
135
|
+
'Provider:Pict-Input-Diagram': 'exercised through InputType:Diagram',
|
|
136
|
+
'Provider:Pict-Input-RichText': 'exercised through InputType:RichText',
|
|
137
|
+
'Provider:Pict-Input-ObjectEditor': 'exercised through InputType:ObjectEditor',
|
|
138
|
+
'Provider:Pict-Input-Templated': 'exercised through InputType:Templated',
|
|
139
|
+
'Provider:Pict-Input-TemplatedEntityLookup': 'exercised through InputType:TemplatedEntityLookup',
|
|
140
|
+
'Provider:Pict-Input-TabGroupSelector': 'exercised through InputType:TabGroupSelector',
|
|
141
|
+
'Provider:Pict-Input-TabSectionSelector': 'exercised through InputType:TabSectionSelector',
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Solver directives the fixture manifest does not use, and why. The rest must appear in a fixture solver.
|
|
145
|
+
const EXCLUDED_SOLVER_DIRECTIVES =
|
|
146
|
+
{
|
|
147
|
+
MONTECARLO: 'samples at random, so it cannot be compared between two injections; asserted at the expression level in Pict-View-Form-Metacontroller-DistinctManifest_tests.js',
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// The shapes a solver can name something of its own in. Each must appear somewhere in the fixture manifest.
|
|
151
|
+
const REFERENCE_SHAPES =
|
|
152
|
+
{
|
|
153
|
+
'exact symbol': /(^|[^A-Za-z0-9_$.])Width([^A-Za-z0-9_$.]|$)/,
|
|
154
|
+
'state address': /\{Rows\[1\]\.Line\}/,
|
|
155
|
+
'dotted length': /Rows\.length/,
|
|
156
|
+
'indexed element': /Readings\[0\]/,
|
|
157
|
+
'indexed property': /Rows\[0\]\.Line/,
|
|
158
|
+
'set property': /Rows\[\]\.Line/,
|
|
159
|
+
'nested property of an object': /Crate\.Items\.length/,
|
|
160
|
+
'marshal destination prefixed string': /GETVALUE\("AppData\.Orchard\.Width"\)/,
|
|
161
|
+
'marshal destination prefixed partial': /GETVALUE\("AppData\.Orchard\.Rows\[1\]\.Qty"\)/,
|
|
162
|
+
'hash string parameter': /SetSectionVisibility\("Extras"/,
|
|
163
|
+
'string literal that matches a hash': /"Width", "Narrow"/,
|
|
164
|
+
'reference outside the manifest': /HostRate/,
|
|
165
|
+
'record set solver column': /Line = Qty \* Price/,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// Properties that hold prose or presentation rather than a reference, so the unsalted-reference scan skips
|
|
169
|
+
// them. Add to this list only when a property genuinely cannot name a section, group, input or address.
|
|
170
|
+
const LABEL_PROPERTIES =
|
|
171
|
+
[
|
|
172
|
+
'Name', 'Description', 'Label', 'Hint', 'Placeholder', 'CSSClass', 'CSSClasses', 'Scope', 'DataType', 'InputType',
|
|
173
|
+
'TabSectionNames', 'TabGroupNames', 'Layout', 'Row', 'Width', 'InputExtra', 'ChartType', 'Entity', 'Providers',
|
|
174
|
+
'RecordManifest', 'SelectOptions', 'OriginalHash', 'OriginalDataAddress',
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
// What the fixture demonstrates rather than asserts, because it is a property of injection itself rather
|
|
178
|
+
// than of the translation. Each is reported; the suites print them instead of failing on them.
|
|
179
|
+
const KNOWN_OPEN =
|
|
180
|
+
{
|
|
181
|
+
UndeclaredSolverTargets: 'a solver can assign to a name no descriptor declares (Scratch), and the expression parser assigns an expression with no assignment of its own to Result; neither is nested into the copy, so the copies share them',
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// Keys an injected copy leaves at the unsalted root that are not copy data.
|
|
185
|
+
const KNOWN_ROOT_KEYS =
|
|
186
|
+
{
|
|
187
|
+
Result: { Severity: 'open', Reason: 'the expression parser assigns a solver with no assignment to Result, which no manifest rewrite can reach' },
|
|
188
|
+
MetaTemplate: { Severity: 'benign', Reason: 'a container the metatemplate manifest defaults into the marshal destination, holding no copy data' },
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
module.exports = {
|
|
192
|
+
MARSHAL_DESTINATION,
|
|
193
|
+
SALTS,
|
|
194
|
+
ROOT_DECOYS,
|
|
195
|
+
COPIES,
|
|
196
|
+
INPUT_CASES,
|
|
197
|
+
EXCLUDED_REGISTRY_ENTRIES,
|
|
198
|
+
EXCLUDED_SOLVER_DIRECTIVES,
|
|
199
|
+
REFERENCE_SHAPES,
|
|
200
|
+
LABEL_PROPERTIES,
|
|
201
|
+
KNOWN_ROOT_KEYS,
|
|
202
|
+
KNOWN_OPEN,
|
|
203
|
+
};
|