@@ -60,10 +60,10 @@ describe('ChannelParameter model', function() {
60
60
expect ( d . hasSchema ( ) ) . toEqual ( true ) ;
61
61
} ) ;
62
62
63
- it ( 'should return false when there is no value' , function ( ) {
63
+ it ( 'should return true when there is no value' , function ( ) {
64
64
const doc = serializeInput < v3 . ParameterObject > ( { } ) ;
65
65
const d = new ChannelParameter ( doc ) ;
66
- expect ( d . hasSchema ( ) ) . toEqual ( false ) ;
66
+ expect ( d . hasSchema ( ) ) . toEqual ( true ) ;
67
67
} ) ;
68
68
} ) ;
69
69
@@ -87,10 +87,17 @@ describe('ChannelParameter model', function() {
87
87
expect ( d . schema ( ) ?. default ( ) ) . toEqual ( 'test' ) ;
88
88
} ) ;
89
89
90
- it ( 'should return undefined when there is no value' , function ( ) {
90
+ it ( 'should be able to access description value' , function ( ) {
91
+ const doc = serializeInput < v3 . ParameterObject > ( { description : 'test' } ) ;
92
+ const d = new ChannelParameter ( doc ) ;
93
+ expect ( d . schema ( ) ) . toBeInstanceOf ( Schema ) ;
94
+ expect ( d . schema ( ) ?. description ( ) ) . toEqual ( 'test' ) ;
95
+ } ) ;
96
+ it ( 'should return empty schema with type string when there is no value' , function ( ) {
91
97
const doc = serializeInput < v3 . ParameterObject > ( { } ) ;
92
98
const d = new ChannelParameter ( doc ) ;
93
- expect ( d . schema ( ) ) . toBeUndefined ( ) ;
99
+ expect ( d . schema ( ) ) . toBeInstanceOf ( Schema ) ;
100
+ expect ( d . schema ( ) ?. type ( ) ) . toEqual ( 'string' ) ;
94
101
} ) ;
95
102
} ) ;
96
103
0 commit comments