Skip to content

Commit

Permalink
add test for #952
Browse files Browse the repository at this point in the history
  • Loading branch information
ytausch committed Jan 7, 2025
1 parent 1e3d5ce commit 142f2a4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/hover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,32 @@ Source: [${SCHEMA_ID}](file:///${SCHEMA_ID})`
);
expect(telemetry.messages).to.be.empty;
});
it('should show the parent description in anyOf (no child descriptions)', async () => {
schemaProvider.addSchema(SCHEMA_ID, {
title: 'The Root',
description: 'Root Object',
type: 'object',
properties: {
optionalZipFile: {
title: 'ZIP file',
anyOf: [{ type: "string", pattern: "\\.zip$" }, { type: "null" }],
default: null,
description: "Optional ZIP file path."
},
},
required: ['optionalZipFile'],
additionalProperties: false,
});
let content = 'optionalZipF|i|le:';
let result = await parseSetup(content);

assert.strictEqual(MarkupContent.is(result.contents), true);
assert.strictEqual(
(result.contents as MarkupContent).value,
`#### ZIP file || ZIP file\n\nOptional ZIP file path.\n\nSource: [${SCHEMA_ID}](file:///${SCHEMA_ID})`
);
expect(telemetry.messages).to.be.empty;
});
});

describe('Bug fixes', () => {
Expand Down

0 comments on commit 142f2a4

Please sign in to comment.