@@ -55,14 +55,16 @@ describe('Adanos request configuration', () => {
5555 it ( 'builds a crypto trending URL with a bounded result limit' , ( ) => {
5656 const buildUrl = adanosTrendingTool . request . url as ( params : {
5757 apiKey : string
58- assetType : 'crypto'
58+ assetType : 'crypto' | ' Crypto '
5959 source : 'polymarket'
6060 limit : number
6161 } ) => string
6262
63- expect ( buildUrl ( { apiKey : 'key' , assetType : 'crypto' , source : 'polymarket' , limit : 25 } ) ) . toBe (
64- 'https://api.adanos.org/reddit/crypto/v1/trending?limit=25'
65- )
63+ for ( const assetType of [ 'crypto' , ' Crypto ' ] as const ) {
64+ expect ( buildUrl ( { apiKey : 'key' , assetType, source : 'polymarket' , limit : 25 } ) ) . toBe (
65+ 'https://api.adanos.org/reddit/crypto/v1/trending?limit=25'
66+ )
67+ }
6668 } )
6769
6870 it ( 'rejects unsupported stock sources and out-of-range limits' , ( ) => {
@@ -210,4 +212,14 @@ describe('Adanos block configuration', () => {
210212 } )
211213 ) . toMatchObject ( { limit : 20 , source : undefined , startDate : undefined , endDate : undefined } )
212214 } )
215+
216+ it ( 'hides stock source selection for crypto operations' , ( ) => {
217+ const sourceBlock = AdanosBlock . subBlocks . find ( ( subBlock ) => subBlock . id === 'source' )
218+
219+ expect ( sourceBlock ?. condition ) . toEqual ( {
220+ field : 'operation' ,
221+ value : [ 'stock_sentiment' , 'trending' , 'market_sentiment' ] ,
222+ and : { field : 'assetType' , value : 'crypto' , not : true } ,
223+ } )
224+ } )
213225} )
0 commit comments