@@ -162,42 +162,5 @@ module.exports = (createCommon, options) => {
162162 } )
163163 } )
164164 } )
165-
166- it ( 'should get links from CBOR object' , ( done ) => {
167- const hashes = [ ]
168- ipfs . add ( Buffer . from ( 'test data' ) , ( err , res1 ) => {
169- expect ( err ) . to . not . exist ( )
170- hashes . push ( res1 [ 0 ] . hash )
171- ipfs . add ( Buffer . from ( 'more test data' ) , ( err , res2 ) => {
172- hashes . push ( res2 [ 0 ] . hash )
173- expect ( err ) . to . not . exist ( )
174- const obj = {
175- some : 'data' ,
176- mylink : { '/' : hashes [ 0 ] } ,
177- myobj : {
178- anotherLink : { '/' : hashes [ 1 ] }
179- }
180- }
181- ipfs . dag . put ( obj , ( err , cid ) => {
182- expect ( err ) . to . not . exist ( )
183- ipfs . object . links ( cid , ( err , links ) => {
184- expect ( err ) . to . not . exist ( )
185- expect ( links . length ) . to . eql ( 2 )
186-
187- // TODO: js-ipfs succeeds but go returns empty strings for link name
188- // const names = [links[0].name, links[1].name]
189- // expect(names).includes('mylink')
190- // expect(names).includes('myobj/anotherLink')
191-
192- const cids = [ links [ 0 ] . cid . toString ( ) , links [ 1 ] . cid . toString ( ) ]
193- expect ( cids ) . includes ( hashes [ 0 ] )
194- expect ( cids ) . includes ( hashes [ 1 ] )
195-
196- done ( )
197- } )
198- } )
199- } )
200- } )
201- } )
202165 } )
203166}
0 commit comments