mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
test: walk along dependency chains
This commit is contained in:
@@ -193,7 +193,7 @@ export class SchemaSpec {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const type = property.type!;
|
let type = property.type!;
|
||||||
|
|
||||||
if (isIntrinsicType(type)) {
|
if (isIntrinsicType(type)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -212,10 +212,24 @@ export class SchemaSpec {
|
|||||||
fail(`'${thingName}'#'${property.name}' element type '${elementType.type}' is not handled by this test!`);
|
fail(`'${thingName}'#'${property.name}' element type '${elementType.type}' is not handled by this test!`);
|
||||||
}
|
}
|
||||||
} else if (isReferenceType(type)) {
|
} else if (isReferenceType(type)) {
|
||||||
expect(SchemaSpec.thingNames).not.to.contain(
|
do {
|
||||||
type.name,
|
expect(SchemaSpec.thingNames).not.to.contain(
|
||||||
`Property '${property.name}' on type '${thingName}' has element type '${type.name}'.`,
|
type.name,
|
||||||
);
|
`Property '${property.name}' on type '${thingName}' has element type '${type.name}'.`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const referencedObject = SchemaSpec.objects[type.name];
|
||||||
|
if (typeof referencedObject !== 'undefined') {
|
||||||
|
const referencedType = referencedObject.type;
|
||||||
|
if (typeof referencedType !== 'undefined') {
|
||||||
|
type = referencedType;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} while (isReferenceType(type));
|
||||||
} else if (isUnionType(type)) {
|
} else if (isUnionType(type)) {
|
||||||
for (const nestedType of type.types) {
|
for (const nestedType of type.types) {
|
||||||
if (isIntrinsicType(nestedType) || isStringLiteralType(nestedType)) {
|
if (isIntrinsicType(nestedType) || isStringLiteralType(nestedType)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user