File tree Expand file tree Collapse file tree
apps/commandboard-api/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ describe("CommandBoard API contracts", () => {
9898 const providersBody = await providersResponse . json ( ) as { providers : Array < { id : string ; enabledByDefault : boolean } > } ;
9999 const discoverResponse = await fetch ( `${ baseUrl } /api/feeds/discover?q=microsaas&providers=manual-curated&includeUnvalidated=true` ) ;
100100 const discoverBody = await discoverResponse . json ( ) as { query : string ; results : Array < { feedUrl : string ; provider : string } > } ;
101+ const invalidLimitResponse = await fetch ( `${ baseUrl } /api/feeds/discover?q=microsaas&limit=-1&providers=manual-curated&includeUnvalidated=true` ) ;
102+ const invalidLimitBody = await invalidLimitResponse . json ( ) as { results : Array < { feedUrl : string ; provider : string } > } ;
101103 const rssResponse = await fetch ( `${ baseUrl } /rss/discover/microsaas.xml?providers=manual-curated&includeUnvalidated=true` ) ;
102104 const rssBody = await rssResponse . text ( ) ;
103105 const opmlResponse = await fetch ( `${ baseUrl } /opml/discover/microsaas.xml?providers=manual-curated&includeUnvalidated=true` ) ;
@@ -108,6 +110,8 @@ describe("CommandBoard API contracts", () => {
108110 expect ( discoverResponse . status ) . toBe ( 200 ) ;
109111 expect ( discoverBody . query ) . toBe ( "microsaas" ) ;
110112 expect ( discoverBody . results [ 0 ] ) . toMatchObject ( { provider : "manual-curated" } ) ;
113+ expect ( invalidLimitResponse . status ) . toBe ( 200 ) ;
114+ expect ( invalidLimitBody . results [ 0 ] ) . toMatchObject ( { provider : "manual-curated" } ) ;
111115 expect ( rssResponse . status ) . toBe ( 200 ) ;
112116 expect ( rssBody ) . toContain ( "<rss" ) ;
113117 expect ( opmlResponse . status ) . toBe ( 200 ) ;
Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ function numberParam(value: string | null) {
331331 return undefined ;
332332 }
333333 const parsed = Number ( value ) ;
334- return Number . isFinite ( parsed ) ? parsed : undefined ;
334+ return Number . isFinite ( parsed ) && parsed > 0 ? parsed : undefined ;
335335}
336336
337337function listParam ( value : string | null ) {
You can’t perform that action at this time.
0 commit comments