diff --git a/src/models/v3/channel-parameter.ts b/src/models/v3/channel-parameter.ts index 54099a351..41e46bfab 100644 --- a/src/models/v3/channel-parameter.ts +++ b/src/models/v3/channel-parameter.ts @@ -13,16 +13,10 @@ export class ChannelParameter extends BaseModel({}); const d = new ChannelParameter(doc); - expect(d.hasSchema()).toEqual(false); + expect(d.hasSchema()).toEqual(true); }); }); @@ -87,10 +87,17 @@ describe('ChannelParameter model', function() { expect(d.schema()?.default()).toEqual('test'); }); - it('should return undefined when there is no value', function() { + it('should be able to access description value', function() { + const doc = serializeInput({ description: 'test' }); + const d = new ChannelParameter(doc); + expect(d.schema()).toBeInstanceOf(Schema); + expect(d.schema()?.description()).toEqual('test'); + }); + it('should return empty schema with type string when there is no value', function() { const doc = serializeInput({}); const d = new ChannelParameter(doc); - expect(d.schema()).toBeUndefined(); + expect(d.schema()).toBeInstanceOf(Schema); + expect(d.schema()?.type()).toEqual('string'); }); });