@pdtf/schemas 2.0.0-1 → 2.0.0-2
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/index.js +12 -9
- package/package.json +1 -1
- package/src/examples/v2/exampleTransaction.json +17 -6
- package/src/schemas/v2/combined.json +12 -10
- package/src/schemas/v2/core.json +6 -7
- package/src/schemas/v2/merged.json +13 -9
- package/src/schemas/v2/overlays/baspi.json +13 -9
- package/src/tests/v2/transactionSchema.test.js +15 -24
package/index.js
CHANGED
|
@@ -105,7 +105,8 @@ const getValidator = (schemaId, overlay = "baspiV4") => {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
// common functions for v1 and v2
|
|
108
|
-
const getSubschema = (path,
|
|
108
|
+
const getSubschema = (path, schemaId, overlay) => {
|
|
109
|
+
const sourceSchema = getTransactionSchema(schemaId, overlay);
|
|
109
110
|
const pathArray = path.split("/").slice(1);
|
|
110
111
|
if (pathArray.length < 1) return sourceSchema;
|
|
111
112
|
return pathArray.reduce((schema, pathElement) => {
|
|
@@ -127,23 +128,25 @@ const getSubschema = (path, sourceSchema = transactionSchema) => {
|
|
|
127
128
|
}, sourceSchema);
|
|
128
129
|
};
|
|
129
130
|
|
|
130
|
-
const isPathValid = (path,
|
|
131
|
+
const isPathValid = (path, schemaId, overlay) => {
|
|
132
|
+
const schema = getTransactionSchema(schemaId, overlay);
|
|
131
133
|
try {
|
|
132
|
-
return getSubschema(path,
|
|
134
|
+
return getSubschema(path, schemaId, overlay) !== undefined;
|
|
133
135
|
} catch (err) {
|
|
134
136
|
return false;
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
139
|
|
|
138
|
-
const getSubschemaValidator = (path,
|
|
139
|
-
const subSchema = getSubschema(path,
|
|
140
|
+
const getSubschemaValidator = (path, schemaId, overlay) => {
|
|
141
|
+
const subSchema = getSubschema(path, schemaId, overlay);
|
|
140
142
|
// see if we can retrieve the schema by path
|
|
141
|
-
|
|
143
|
+
const cacheKey = `${path}-${schemaId}`;
|
|
144
|
+
let validator = ajv.getSchema(cacheKey);
|
|
142
145
|
// retrieve whole schema by $id if available
|
|
143
|
-
if (!validator && subSchema.$id) validator = ajv.getSchema(
|
|
146
|
+
if (!validator && subSchema.$id) validator = ajv.getSchema(cacheKey);
|
|
144
147
|
if (!validator) {
|
|
145
|
-
ajv.addSchema(subSchema,
|
|
146
|
-
validator = ajv.getSchema(
|
|
148
|
+
ajv.addSchema(subSchema, cacheKey);
|
|
149
|
+
validator = ajv.getSchema(cacheKey);
|
|
147
150
|
}
|
|
148
151
|
return validator;
|
|
149
152
|
};
|
package/package.json
CHANGED
|
@@ -119,12 +119,15 @@
|
|
|
119
119
|
"isStandardForm": {
|
|
120
120
|
"yesNo": "Yes"
|
|
121
121
|
},
|
|
122
|
-
"
|
|
122
|
+
"buildingSafetyRemediation": { "yesNo": "No" },
|
|
123
|
+
"sprayFoamInsulation": {
|
|
124
|
+
"hasSprayFoamInstalled": "No"
|
|
125
|
+
}
|
|
123
126
|
},
|
|
124
127
|
"energyEfficiency": {
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
+
"certificate": {
|
|
129
|
+
"certificateNumber": "12345",
|
|
130
|
+
"currentEnergyRating": "A"
|
|
128
131
|
}
|
|
129
132
|
},
|
|
130
133
|
"councilTax": {
|
|
@@ -428,7 +431,7 @@
|
|
|
428
431
|
}
|
|
429
432
|
}
|
|
430
433
|
},
|
|
431
|
-
"
|
|
434
|
+
"environmentalIssues": {
|
|
432
435
|
"flooding": {
|
|
433
436
|
"floodRiskReport": { "yesNo": "No" },
|
|
434
437
|
"hasBeenFlooded": "Yes",
|
|
@@ -460,7 +463,9 @@
|
|
|
460
463
|
},
|
|
461
464
|
"otherEnvironmental": {
|
|
462
465
|
"yesNo": "No"
|
|
463
|
-
}
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"otherIssues": {
|
|
464
469
|
"excessiveNoise": {
|
|
465
470
|
"yesNo": "No"
|
|
466
471
|
},
|
|
@@ -493,6 +498,12 @@
|
|
|
493
498
|
"ownerType": "Private individual",
|
|
494
499
|
"firstName": "Peter",
|
|
495
500
|
"lastName": "Hetherington-Smythe"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"ownerType": "Private individual",
|
|
504
|
+
"firstName": "Clarissa",
|
|
505
|
+
"middleNames": "Jane",
|
|
506
|
+
"lastName": "Hetherington-Smythe"
|
|
496
507
|
}
|
|
497
508
|
]
|
|
498
509
|
},
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
"insurance",
|
|
156
156
|
"boundaries",
|
|
157
157
|
"rightsAndInformalArrangements",
|
|
158
|
+
"environmentalIssues",
|
|
158
159
|
"otherIssues",
|
|
159
160
|
"additionalInformation",
|
|
160
161
|
"consumerProtectionRegulationsDeclaration"
|
|
@@ -7051,7 +7052,8 @@
|
|
|
7051
7052
|
"type": "object",
|
|
7052
7053
|
"baspiRequired": [
|
|
7053
7054
|
"isStandardForm",
|
|
7054
|
-
"
|
|
7055
|
+
"buildingSafetyRemediation",
|
|
7056
|
+
"sprayFoamInsulation"
|
|
7055
7057
|
],
|
|
7056
7058
|
"properties": {
|
|
7057
7059
|
"isStandardForm": {
|
|
@@ -7142,38 +7144,38 @@
|
|
|
7142
7144
|
}
|
|
7143
7145
|
]
|
|
7144
7146
|
},
|
|
7145
|
-
"
|
|
7147
|
+
"sprayFoamInsulation": {
|
|
7146
7148
|
"baspiRef": "A1.8.4",
|
|
7147
7149
|
"title": "Has spray foam insulation been installed at the property?",
|
|
7148
7150
|
"type": "object",
|
|
7149
7151
|
"properties": {
|
|
7150
|
-
"
|
|
7152
|
+
"hasSprayFoamInstalled": {
|
|
7151
7153
|
"baspiRef": "A1.8.4.1",
|
|
7152
7154
|
"type": "string",
|
|
7153
7155
|
"title": "",
|
|
7154
7156
|
"enum": ["Yes", "No"]
|
|
7155
7157
|
}
|
|
7156
7158
|
},
|
|
7157
|
-
"baspiRequired": ["
|
|
7159
|
+
"baspiRequired": ["hasSprayFoamInstalled"],
|
|
7158
7160
|
"discriminator": {
|
|
7159
|
-
"propertyName": "
|
|
7161
|
+
"propertyName": "hasSprayFoamInstalled"
|
|
7160
7162
|
},
|
|
7161
7163
|
"oneOf": [
|
|
7162
7164
|
{
|
|
7163
7165
|
"properties": {
|
|
7164
|
-
"
|
|
7166
|
+
"hasSprayFoamInstalled": {
|
|
7165
7167
|
"enum": ["No"]
|
|
7166
7168
|
}
|
|
7167
7169
|
}
|
|
7168
7170
|
},
|
|
7169
7171
|
{
|
|
7170
7172
|
"properties": {
|
|
7171
|
-
"
|
|
7173
|
+
"hasSprayFoamInstalled": {
|
|
7172
7174
|
"enum": ["Yes"]
|
|
7173
7175
|
},
|
|
7174
7176
|
"details": {
|
|
7175
7177
|
"baspiRef": "A1.8.4.2",
|
|
7176
|
-
"title": "
|
|
7178
|
+
"title": "Please give details together with certification from BBA or KIWA and the installation warranty for the work carried out",
|
|
7177
7179
|
"type": "string",
|
|
7178
7180
|
"minLength": 1
|
|
7179
7181
|
},
|
|
@@ -7186,8 +7188,7 @@
|
|
|
7186
7188
|
},
|
|
7187
7189
|
"baspiRequired": ["details", "attachments"]
|
|
7188
7190
|
}
|
|
7189
|
-
]
|
|
7190
|
-
"description": "If yes, please give details together with certification from BBA or KIWA and the installation warranty for the work carried out."
|
|
7191
|
+
]
|
|
7191
7192
|
}
|
|
7192
7193
|
}
|
|
7193
7194
|
},
|
|
@@ -7196,6 +7197,7 @@
|
|
|
7196
7197
|
"rdsRef": "Certificates/{category='energyEfficiency',standard='EPC',gradeLevelRating=?},Certificates/{category='energyEfficiency',standard='EPC',status='exempt'},",
|
|
7197
7198
|
"title": "Energy Efficiency",
|
|
7198
7199
|
"type": "object",
|
|
7200
|
+
"baspiRequired": ["certificate"],
|
|
7199
7201
|
"properties": {
|
|
7200
7202
|
"certificate": {
|
|
7201
7203
|
"baspiRef": "A1.8.3.1",
|
package/src/schemas/v2/core.json
CHANGED
|
@@ -6476,11 +6476,11 @@
|
|
|
6476
6476
|
}
|
|
6477
6477
|
]
|
|
6478
6478
|
},
|
|
6479
|
-
"
|
|
6479
|
+
"sprayFoamInsulation": {
|
|
6480
6480
|
"title": "Has spray foam insulation been installed at the property?",
|
|
6481
6481
|
"type": "object",
|
|
6482
6482
|
"properties": {
|
|
6483
|
-
"
|
|
6483
|
+
"hasSprayFoamInstalled": {
|
|
6484
6484
|
"type": "string",
|
|
6485
6485
|
"title": "",
|
|
6486
6486
|
"enum": [
|
|
@@ -6492,7 +6492,7 @@
|
|
|
6492
6492
|
"oneOf": [
|
|
6493
6493
|
{
|
|
6494
6494
|
"properties": {
|
|
6495
|
-
"
|
|
6495
|
+
"hasSprayFoamInstalled": {
|
|
6496
6496
|
"enum": [
|
|
6497
6497
|
"No"
|
|
6498
6498
|
]
|
|
@@ -6501,13 +6501,13 @@
|
|
|
6501
6501
|
},
|
|
6502
6502
|
{
|
|
6503
6503
|
"properties": {
|
|
6504
|
-
"
|
|
6504
|
+
"hasSprayFoamInstalled": {
|
|
6505
6505
|
"enum": [
|
|
6506
6506
|
"Yes"
|
|
6507
6507
|
]
|
|
6508
6508
|
},
|
|
6509
6509
|
"details": {
|
|
6510
|
-
"title": "
|
|
6510
|
+
"title": "Please give details together with certification from BBA or KIWA and the installation warranty for the work carried out",
|
|
6511
6511
|
"type": "string",
|
|
6512
6512
|
"minLength": 1
|
|
6513
6513
|
},
|
|
@@ -6521,8 +6521,7 @@
|
|
|
6521
6521
|
}
|
|
6522
6522
|
}
|
|
6523
6523
|
}
|
|
6524
|
-
]
|
|
6525
|
-
"description": "If yes, please give details together with certification from BBA or KIWA and the installation warranty for the work carried out."
|
|
6524
|
+
]
|
|
6526
6525
|
}
|
|
6527
6526
|
}
|
|
6528
6527
|
},
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
"insurance",
|
|
152
152
|
"boundaries",
|
|
153
153
|
"rightsAndInformalArrangements",
|
|
154
|
+
"environmentalIssues",
|
|
154
155
|
"otherIssues",
|
|
155
156
|
"additionalInformation",
|
|
156
157
|
"consumerProtectionRegulationsDeclaration"
|
|
@@ -6654,7 +6655,8 @@
|
|
|
6654
6655
|
"title": "Type of Construction",
|
|
6655
6656
|
"required": [
|
|
6656
6657
|
"isStandardForm",
|
|
6657
|
-
"
|
|
6658
|
+
"buildingSafetyRemediation",
|
|
6659
|
+
"sprayFoamInsulation"
|
|
6658
6660
|
],
|
|
6659
6661
|
"properties": {
|
|
6660
6662
|
"isStandardForm": {
|
|
@@ -6770,17 +6772,16 @@
|
|
|
6770
6772
|
},
|
|
6771
6773
|
"type": "object"
|
|
6772
6774
|
},
|
|
6773
|
-
"
|
|
6775
|
+
"sprayFoamInsulation": {
|
|
6774
6776
|
"baspiRef": "A1.8.4",
|
|
6775
6777
|
"title": "Has spray foam insulation been installed at the property?",
|
|
6776
|
-
"description": "If yes, please give details together with certification from BBA or KIWA and the installation warranty for the work carried out.",
|
|
6777
6778
|
"discriminator": {
|
|
6778
|
-
"propertyName": "
|
|
6779
|
+
"propertyName": "hasSprayFoamInstalled"
|
|
6779
6780
|
},
|
|
6780
6781
|
"oneOf": [
|
|
6781
6782
|
{
|
|
6782
6783
|
"properties": {
|
|
6783
|
-
"
|
|
6784
|
+
"hasSprayFoamInstalled": {
|
|
6784
6785
|
"enum": [
|
|
6785
6786
|
"No"
|
|
6786
6787
|
]
|
|
@@ -6789,14 +6790,14 @@
|
|
|
6789
6790
|
},
|
|
6790
6791
|
{
|
|
6791
6792
|
"properties": {
|
|
6792
|
-
"
|
|
6793
|
+
"hasSprayFoamInstalled": {
|
|
6793
6794
|
"enum": [
|
|
6794
6795
|
"Yes"
|
|
6795
6796
|
]
|
|
6796
6797
|
},
|
|
6797
6798
|
"details": {
|
|
6798
6799
|
"baspiRef": "A1.8.4.2",
|
|
6799
|
-
"title": "
|
|
6800
|
+
"title": "Please give details together with certification from BBA or KIWA and the installation warranty for the work carried out",
|
|
6800
6801
|
"type": "string",
|
|
6801
6802
|
"minLength": 1
|
|
6802
6803
|
},
|
|
@@ -6817,10 +6818,10 @@
|
|
|
6817
6818
|
}
|
|
6818
6819
|
],
|
|
6819
6820
|
"required": [
|
|
6820
|
-
"
|
|
6821
|
+
"hasSprayFoamInstalled"
|
|
6821
6822
|
],
|
|
6822
6823
|
"properties": {
|
|
6823
|
-
"
|
|
6824
|
+
"hasSprayFoamInstalled": {
|
|
6824
6825
|
"baspiRef": "A1.8.4.1",
|
|
6825
6826
|
"enum": [
|
|
6826
6827
|
"Yes",
|
|
@@ -6838,6 +6839,9 @@
|
|
|
6838
6839
|
"energyEfficiency": {
|
|
6839
6840
|
"baspiRef": "A1.8.3",
|
|
6840
6841
|
"title": "Energy Efficiency",
|
|
6842
|
+
"required": [
|
|
6843
|
+
"certificate"
|
|
6844
|
+
],
|
|
6841
6845
|
"properties": {
|
|
6842
6846
|
"certificate": {
|
|
6843
6847
|
"baspiRef": "A1.8.3.1",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"insurance",
|
|
62
62
|
"boundaries",
|
|
63
63
|
"rightsAndInformalArrangements",
|
|
64
|
+
"environmentalIssues",
|
|
64
65
|
"otherIssues",
|
|
65
66
|
"additionalInformation",
|
|
66
67
|
"consumerProtectionRegulationsDeclaration"
|
|
@@ -1204,7 +1205,8 @@
|
|
|
1204
1205
|
"title": "Type of Construction",
|
|
1205
1206
|
"required": [
|
|
1206
1207
|
"isStandardForm",
|
|
1207
|
-
"
|
|
1208
|
+
"buildingSafetyRemediation",
|
|
1209
|
+
"sprayFoamInsulation"
|
|
1208
1210
|
],
|
|
1209
1211
|
"properties": {
|
|
1210
1212
|
"isStandardForm": {
|
|
@@ -1309,17 +1311,16 @@
|
|
|
1309
1311
|
}
|
|
1310
1312
|
}
|
|
1311
1313
|
},
|
|
1312
|
-
"
|
|
1314
|
+
"sprayFoamInsulation": {
|
|
1313
1315
|
"baspiRef": "A1.8.4",
|
|
1314
1316
|
"title": "Has spray foam insulation been installed at the property?",
|
|
1315
|
-
"description": "If yes, please give details together with certification from BBA or KIWA and the installation warranty for the work carried out.",
|
|
1316
1317
|
"discriminator": {
|
|
1317
|
-
"propertyName": "
|
|
1318
|
+
"propertyName": "hasSprayFoamInstalled"
|
|
1318
1319
|
},
|
|
1319
1320
|
"oneOf": [
|
|
1320
1321
|
{
|
|
1321
1322
|
"properties": {
|
|
1322
|
-
"
|
|
1323
|
+
"hasSprayFoamInstalled": {
|
|
1323
1324
|
"enum": [
|
|
1324
1325
|
"No"
|
|
1325
1326
|
]
|
|
@@ -1328,14 +1329,14 @@
|
|
|
1328
1329
|
},
|
|
1329
1330
|
{
|
|
1330
1331
|
"properties": {
|
|
1331
|
-
"
|
|
1332
|
+
"hasSprayFoamInstalled": {
|
|
1332
1333
|
"enum": [
|
|
1333
1334
|
"Yes"
|
|
1334
1335
|
]
|
|
1335
1336
|
},
|
|
1336
1337
|
"details": {
|
|
1337
1338
|
"baspiRef": "A1.8.4.2",
|
|
1338
|
-
"title": "
|
|
1339
|
+
"title": "Please give details together with certification from BBA or KIWA and the installation warranty for the work carried out"
|
|
1339
1340
|
},
|
|
1340
1341
|
"attachments": {
|
|
1341
1342
|
"baspiRef": "A1.8.4.3",
|
|
@@ -1353,10 +1354,10 @@
|
|
|
1353
1354
|
}
|
|
1354
1355
|
],
|
|
1355
1356
|
"required": [
|
|
1356
|
-
"
|
|
1357
|
+
"hasSprayFoamInstalled"
|
|
1357
1358
|
],
|
|
1358
1359
|
"properties": {
|
|
1359
|
-
"
|
|
1360
|
+
"hasSprayFoamInstalled": {
|
|
1360
1361
|
"baspiRef": "A1.8.4.1",
|
|
1361
1362
|
"enum": [
|
|
1362
1363
|
"Yes",
|
|
@@ -1370,6 +1371,9 @@
|
|
|
1370
1371
|
"energyEfficiency": {
|
|
1371
1372
|
"baspiRef": "A1.8.3",
|
|
1372
1373
|
"title": "Energy Efficiency",
|
|
1374
|
+
"required": [
|
|
1375
|
+
"certificate"
|
|
1376
|
+
],
|
|
1373
1377
|
"properties": {
|
|
1374
1378
|
"certificate": {
|
|
1375
1379
|
"baspiRef": "A1.8.3.1",
|
|
@@ -59,46 +59,37 @@ test("sample with missing dependent required fields is invalid", () => {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
test("correctly gets a top level subschema", () => {
|
|
62
|
-
const subschema = getSubschema("/propertyPack"
|
|
62
|
+
const subschema = getSubschema("/propertyPack");
|
|
63
63
|
expect(subschema.title).toBe("Property Pack");
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
test("correctly identifies a valid path", () => {
|
|
67
|
-
const isValid = isPathValid(
|
|
68
|
-
"/propertyPack/materialFacts",
|
|
69
|
-
v2TransactionSchema
|
|
70
|
-
);
|
|
67
|
+
const isValid = isPathValid("/propertyPack/materialFacts");
|
|
71
68
|
expect(isValid).toBe(true);
|
|
72
69
|
});
|
|
73
70
|
|
|
74
71
|
test("correctly identifies an undefined invalid path", () => {
|
|
75
|
-
const isValid = isPathValid(
|
|
76
|
-
"/propertyPack/materialItems",
|
|
77
|
-
v2TransactionSchema
|
|
78
|
-
);
|
|
72
|
+
const isValid = isPathValid("/propertyPack/materialItems");
|
|
79
73
|
expect(isValid).toBe(false);
|
|
80
74
|
});
|
|
81
75
|
|
|
82
76
|
test("correctly identifies an error generating invalid path", () => {
|
|
83
77
|
const isValid = isPathValid(
|
|
84
78
|
"/propertyPack/materialItems/someProperty/item",
|
|
85
|
-
|
|
79
|
+
schemaId
|
|
86
80
|
);
|
|
87
81
|
expect(isValid).toBe(false);
|
|
88
82
|
});
|
|
89
83
|
|
|
90
84
|
test("correctly identifies an array invalid path", () => {
|
|
91
|
-
const isValid = isPathValid(
|
|
92
|
-
"/propertyPack/materialFacts/1/item",
|
|
93
|
-
v2TransactionSchema
|
|
94
|
-
);
|
|
85
|
+
const isValid = isPathValid("/propertyPack/materialFacts/1/item");
|
|
95
86
|
expect(isValid).toBe(false);
|
|
96
87
|
});
|
|
97
88
|
|
|
98
89
|
test("correctly gets a subschema", () => {
|
|
99
90
|
const subschema = getSubschema(
|
|
100
91
|
"/propertyPack/materialFacts/notices",
|
|
101
|
-
|
|
92
|
+
schemaId
|
|
102
93
|
);
|
|
103
94
|
expect(subschema.title).toBe("Notices which Affect the Property");
|
|
104
95
|
});
|
|
@@ -106,7 +97,7 @@ test("correctly gets a subschema", () => {
|
|
|
106
97
|
test("correctly gets a subschema through an arrays element", () => {
|
|
107
98
|
const subschema = getSubschema(
|
|
108
99
|
"/propertyPack/titlesToBeSold/0/registerExtract",
|
|
109
|
-
|
|
100
|
+
schemaId
|
|
110
101
|
);
|
|
111
102
|
expect(Object.keys(subschema.properties)).toEqual([
|
|
112
103
|
"OCSummaryData",
|
|
@@ -117,7 +108,7 @@ test("correctly gets a subschema through an arrays element", () => {
|
|
|
117
108
|
test("correctly gets a subschema through a dependency", () => {
|
|
118
109
|
const subschema = getSubschema(
|
|
119
110
|
"/propertyPack/materialFacts/delayFactors/hasDelayFactors/details",
|
|
120
|
-
|
|
111
|
+
schemaId
|
|
121
112
|
);
|
|
122
113
|
expect(subschema.title).toBe("Details");
|
|
123
114
|
});
|
|
@@ -125,16 +116,16 @@ test("correctly gets a subschema through a dependency", () => {
|
|
|
125
116
|
test("correctly gets another subschema through a dependency", () => {
|
|
126
117
|
const subschema = getSubschema(
|
|
127
118
|
"/propertyPack/materialFacts/ownership/ownershipsToBeTransferred/0/leaseholdInformation/general/leaseTerm/lengthOfLeaseInYears",
|
|
128
|
-
|
|
119
|
+
schemaId
|
|
129
120
|
);
|
|
130
121
|
expect(subschema.title).toBe("Length of lease (years)");
|
|
131
122
|
});
|
|
132
123
|
|
|
133
124
|
test("correctly gets yet another subschema through a dependency", () => {
|
|
134
125
|
const subschema = getSubschema(
|
|
135
|
-
"/propertyPack/materialFacts/ownership/ownershipsToBeTransferred/0/
|
|
126
|
+
"/propertyPack/materialFacts/ownership/ownershipsToBeTransferred/0/leaseholdInformation/groundRent/rentSubjectToIncrease/rentIncreaseCalculated"
|
|
136
127
|
);
|
|
137
|
-
expect(subschema.title).toBe("
|
|
128
|
+
expect(subschema.title).toBe("How is the increase calculated?");
|
|
138
129
|
});
|
|
139
130
|
|
|
140
131
|
test("correctly gets yet, yet another subschema through a dependency", () => {
|
|
@@ -147,7 +138,7 @@ test("correctly gets yet, yet another subschema through a dependency", () => {
|
|
|
147
138
|
|
|
148
139
|
test("correctly gets yet, yet, yet another subschema through a dependency", () => {
|
|
149
140
|
const subschema = getSubschema(
|
|
150
|
-
"/propertyPack/materialFacts/
|
|
141
|
+
"/propertyPack/materialFacts/environmentalIssues/flooding/typeOfFlooding/groundWater/yesNo"
|
|
151
142
|
);
|
|
152
143
|
expect(subschema.type).toBe("string");
|
|
153
144
|
expect(subschema.enum).toStrictEqual(["Yes", "No"]);
|
|
@@ -155,7 +146,7 @@ test("correctly gets yet, yet, yet another subschema through a dependency", () =
|
|
|
155
146
|
|
|
156
147
|
test("correctly gets yet, yet, yet another subschema through a second item dependency", () => {
|
|
157
148
|
const subschema = getSubschema(
|
|
158
|
-
"/propertyPack/materialFacts/
|
|
149
|
+
"/propertyPack/materialFacts/environmentalIssues/flooding/typeOfFlooding"
|
|
159
150
|
);
|
|
160
151
|
expect(subschema.type).toBe("object");
|
|
161
152
|
});
|
|
@@ -176,11 +167,11 @@ test("correctly gets yes another subschema but through a non-baspi oneOf structu
|
|
|
176
167
|
|
|
177
168
|
test("correctly gets a subschema validator which is already cached", () => {
|
|
178
169
|
const validator = getSubschemaValidator(
|
|
179
|
-
"/propertyPack/
|
|
170
|
+
"/propertyPack/materialFacts/energyEfficiency/certificate"
|
|
180
171
|
);
|
|
181
172
|
expect(validator).not.toBeNull();
|
|
182
173
|
const anotherValidator = getSubschemaValidator(
|
|
183
|
-
"/propertyPack/
|
|
174
|
+
"/propertyPack/materialFacts/energyEfficiency/certificate"
|
|
184
175
|
);
|
|
185
176
|
expect(anotherValidator).not.toBeNull();
|
|
186
177
|
});
|