@@ -47,21 +47,29 @@ describe('testing Generic Routes Utils', () => {
47
47
48
48
describe ( 'creating generic schema [createDefaultSchema]' , ( ) => {
49
49
test ( 'create generic schema without additional properties' , ( ) => {
50
- const successResponseSchema = { generic : 'example' }
50
+ const successResponseSchema = { generic : 'example' , description : 'Successful response' }
51
51
const response = {
52
52
headers : { $ref : 'authSchema#' } ,
53
- response : { 200 : successResponseSchema , '4xx' : { $ref : 'errorSchema#' } } ,
53
+ response : {
54
+ 200 : successResponseSchema ,
55
+ '4xx' : { $ref : 'errorSchema#' , description : 'Error response' } ,
56
+ } ,
54
57
}
55
58
56
59
expect ( createDefaultSchema ( successResponseSchema , { } ) ) . toEqual ( response )
57
60
} )
58
61
59
62
test ( 'create generic schema with additional properties' , ( ) => {
60
- const successResponseSchema = { generic : 'example' }
63
+ const successResponseSchema = { generic : 'example' , description : 'Successful response' }
61
64
const additionalProperties = { generic : 'example' }
62
65
const response = {
63
- headers : { $ref : 'authSchema#' } ,
64
- response : { 200 : successResponseSchema , '4xx' : { $ref : 'errorSchema#' } } ,
66
+ headers : {
67
+ $ref : 'authSchema#' ,
68
+ } ,
69
+ response : {
70
+ 200 : successResponseSchema ,
71
+ '4xx' : { $ref : 'errorSchema#' , description : 'Error response' } ,
72
+ } ,
65
73
...additionalProperties ,
66
74
}
67
75
0 commit comments