Skip to content

Commit b428aa1

Browse files
fix(test): fix app directory test assertions and schema ambiguity
1 parent 57e845f commit b428aa1

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/fdc3-standard/src/app-directory/specification/appd.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@
656656
},
657657
"LaunchDetails": {
658658
"description": "The type specific launch details of the application. These details are intended to be vendor-agnostic and MAY be duplicated or overridden by details provided in the hostManifests object for a specific host.",
659-
"oneOf": [
659+
"anyOf": [
660660
{
661661
"$ref": "#/components/schemas/WebAppDetails"
662662
},

packages/fdc3-standard/test/AppDirectory.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ describe('App Directory Schema Validation', () => {
1313

1414
beforeAll(async () => {
1515
// Parse and validate the OpenAPI schema
16-
api = await SwaggerParser.validate(join(specificationDir, 'appd.schema.json'));
16+
const schemaPath = join(specificationDir, 'appd.schema.json');
17+
const schema = JSON.parse(readFileSync(schemaPath, 'utf-8'));
18+
api = await SwaggerParser.validate(schema);
1719
applicationSchema = (api as { components: { schemas: { Application: unknown } } }).components.schemas.Application;
1820
validator = new Validator();
1921
});
@@ -30,10 +32,10 @@ describe('App Directory Schema Validation', () => {
3032

3133
const result = validator.validate(exampleApplication, applicationSchema);
3234

33-
expect(result.valid).toBe(true);
3435
if (!result.valid) {
35-
console.error('Validation errors:', result.errors);
36+
throw new Error(`Validation errors: ${JSON.stringify(result.errors, null, 2)}`);
3637
}
38+
expect(result.valid).toBe(true);
3739
});
3840

3941
it('should validate fdc3-workbench.json example against the Application schema', () => {

0 commit comments

Comments
 (0)