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