Skip to content

Commit 83a460d

Browse files
engine: fix test broken by meta normalization
Not really sure if these tests have any value at all anymore. I definitely don’t think there’s any value in testing the normalization behavior here (the complete behavior is more comprehensively tested in scenario, and the complete behavior has more meaning than checking sub-structures in isolation). For now, the least questionable thing to do (i.e. without thinking about whether to remove tests like this entirely) seems to be expanding the test fixture’s structure to bypass said normalization, and expanding the assertion to match.
1 parent 2514c1b commit 83a460d

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packages/xforms-engine/test/parse/model/ModelDefinition.test.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ describe('ModelDefinition', () => {
3535
`root id="model-definition"`,
3636
t('first-question'),
3737
t('second-question'),
38-
t('third-question')
38+
t('third-question'),
39+
// prettier-ignore
40+
t('orx:meta',
41+
t('orx:instanceID'))
3942
)
4043
),
4144
bind('/root/first-question').type('string'),
4245
bind('/root/second-question').type('string'),
43-
bind('/root/third-question').type('string')
46+
bind('/root/third-question').type('string'),
47+
bind('/root/orx:meta/orx:instanceID').preload('uid')
4448
)
4549
),
4650
// prettier-ignore
@@ -96,6 +100,21 @@ describe('ModelDefinition', () => {
96100
},
97101
children: null,
98102
},
103+
{
104+
type: 'subtree',
105+
bind: {
106+
nodeset: '/root/orx:meta',
107+
},
108+
children: [
109+
{
110+
type: 'leaf-node',
111+
bind: {
112+
nodeset: '/root/orx:meta/orx:instanceID',
113+
},
114+
children: null,
115+
},
116+
],
117+
},
99118
],
100119
});
101120
});

0 commit comments

Comments
 (0)