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 @@ -84,6 +84,8 @@ describe("CommandBoard API contracts", () => {
8484 const providersBody = await providersResponse . json ( ) as { providers : Array < { id : string ; enabledByDefault : boolean } > } ;
8585 const discoverResponse = await fetch ( `${ baseUrl } /api/feeds/discover?q=microsaas&providers=manual-curated&includeUnvalidated=true` ) ;
8686 const discoverBody = await discoverResponse . json ( ) as { query : string ; results : Array < { feedUrl : string ; provider : string } > } ;
87+ const invalidLimitResponse = await fetch ( `${ baseUrl } /api/feeds/discover?q=microsaas&limit=-1&providers=manual-curated&includeUnvalidated=true` ) ;
88+ const invalidLimitBody = await invalidLimitResponse . json ( ) as { results : Array < { feedUrl : string ; provider : string } > } ;
8789 const rssResponse = await fetch ( `${ baseUrl } /rss/discover/microsaas.xml?providers=manual-curated&includeUnvalidated=true` ) ;
8890 const rssBody = await rssResponse . text ( ) ;
8991 const opmlResponse = await fetch ( `${ baseUrl } /opml/discover/microsaas.xml?providers=manual-curated&includeUnvalidated=true` ) ;
@@ -94,6 +96,8 @@ describe("CommandBoard API contracts", () => {
9496 expect ( discoverResponse . status ) . toBe ( 200 ) ;
9597 expect ( discoverBody . query ) . toBe ( "microsaas" ) ;
9698 expect ( discoverBody . results [ 0 ] ) . toMatchObject ( { provider : "manual-curated" } ) ;
99+ expect ( invalidLimitResponse . status ) . toBe ( 200 ) ;
100+ expect ( invalidLimitBody . results [ 0 ] ) . toMatchObject ( { provider : "manual-curated" } ) ;
97101 expect ( rssResponse . status ) . toBe ( 200 ) ;
98102 expect ( rssBody ) . toContain ( "<rss" ) ;
99103 expect ( opmlResponse . status ) . toBe ( 200 ) ;
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ function numberParam(value: string | null) {
299299 return undefined ;
300300 }
301301 const parsed = Number ( value ) ;
302- return Number . isFinite ( parsed ) ? parsed : undefined ;
302+ return Number . isFinite ( parsed ) && parsed > 0 ? parsed : undefined ;
303303}
304304
305305function listParam ( value : string | null ) {
You can’t perform that action at this time.
0 commit comments