File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -382,4 +382,31 @@ describe('dnslink', () => {
382382
383383 expect ( result ) . to . have . deep . nested . property ( '[0].cid' , CID . parse ( 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn' ) )
384384 } )
385+
386+ it ( 'should resolve multiple recursive DNSLink names' , async ( ) => {
387+ dns . query . withArgs ( '_dnslink.foobar.baz' ) . resolves ( dnsResponse ( [ {
388+ name : '_dnslink.foobar.baz.' ,
389+ TTL : 60 ,
390+ type : RecordType . TXT ,
391+ data : 'dnslink=/ipns/qux.quux'
392+ } , {
393+ name : '_dnslink.foobar.baz.' ,
394+ TTL : 60 ,
395+ type : RecordType . TXT ,
396+ // spellchecker:disable-next-line
397+ data : 'dnslink=/ipfs/bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe'
398+ } ] ) )
399+
400+ dns . query . withArgs ( '_dnslink.qux.quux' ) . resolves ( dnsResponse ( [ {
401+ name : '_dnslink.qux.quux.' ,
402+ TTL : 60 ,
403+ type : RecordType . TXT ,
404+ data : 'dnslink=/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'
405+ } ] ) )
406+
407+ const result = await name . resolve ( 'foobar.baz' )
408+
409+ expect ( result ) . to . have . deep . nested . property ( '[0].cid' , CID . parse ( 'bafybeifcaqowoyito3qvsmbwbiugsu4umlxn4ehu223hvtubbfvwyuxjoe' ) )
410+ expect ( result ) . to . have . deep . nested . property ( '[1].cid' , CID . parse ( 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn' ) )
411+ } )
385412} )
You can’t perform that action at this time.
0 commit comments