@@ -193,6 +193,7 @@ describe('video routes', () => {
193193 } ) ;
194194
195195 expect ( response . statusCode ) . toBe ( 400 ) ;
196+ expect ( response . json ( ) . error ) . toBe ( 'Invalid query parameters' ) ;
196197 } ) ;
197198
198199 it ( 'GET / should return 400 for limit out of range' , async ( ) => {
@@ -202,6 +203,7 @@ describe('video routes', () => {
202203 } ) ;
203204
204205 expect ( response . statusCode ) . toBe ( 400 ) ;
206+ expect ( response . json ( ) . error ) . toBe ( 'Invalid query parameters' ) ;
205207 } ) ;
206208
207209 it ( 'GET / should return 400 for negative offset' , async ( ) => {
@@ -211,6 +213,7 @@ describe('video routes', () => {
211213 } ) ;
212214
213215 expect ( response . statusCode ) . toBe ( 400 ) ;
216+ expect ( response . json ( ) . error ) . toBe ( 'Invalid query parameters' ) ;
214217 } ) ;
215218} ) ;
216219
@@ -245,6 +248,9 @@ describe('trend routes', () => {
245248
246249 expect ( response . statusCode ) . toBe ( 200 ) ;
247250 expect ( response . json ( ) ) . toHaveProperty ( 'trends' ) ;
251+ expect ( response . json ( ) . trends ) . toEqual ( [
252+ { id : 1 , period : 'daily' , keywordName : 'Keyword1' , topVideoTitle : 'Top Video' } ,
253+ ] ) ;
248254 } ) ;
249255
250256 it ( 'GET / should return 400 for invalid query parameters' , async ( ) => {
@@ -275,6 +281,8 @@ describe('trend routes', () => {
275281 } ) ;
276282
277283 expect ( response . statusCode ) . toBe ( 200 ) ;
284+ expect ( response . json ( ) ) . toHaveProperty ( 'trends' ) ;
285+ expect ( response . json ( ) . trends [ 0 ] . keywordName ) . toBe ( 'React' ) ;
278286 } ) ;
279287} ) ;
280288
@@ -307,6 +315,7 @@ describe('log routes', () => {
307315
308316 expect ( response . statusCode ) . toBe ( 200 ) ;
309317 expect ( response . json ( ) ) . toHaveProperty ( 'logs' ) ;
318+ expect ( response . json ( ) . logs ) . toEqual ( JSON . parse ( JSON . stringify ( mockLogs ) ) ) ;
310319 } ) ;
311320
312321 it ( 'GET / should respect custom limit parameter' , async ( ) => {
0 commit comments