@@ -31,11 +31,15 @@ module.exports = (createCommon, options) => {
31
31
32
32
after ( ( done ) => common . teardown ( done ) )
33
33
34
- // This test should be changed to the recursive logic when recursive === true is the default
35
34
it ( 'should resolve a record default options' , async ( ) => {
36
35
const [ { path } ] = await ipfs . add ( Buffer . from ( 'should resolve a record default options' ) )
36
+
37
+ const { id : keyId } = await ipfs . key . gen ( 'key-name-default' , { type : 'rsa' , size : 2048 } )
38
+
37
39
await ipfs . name . publish ( path , { 'allow-offline' : true } )
38
- return expect ( ipfs . name . resolve ( `/ipns/${ nodeId } ` ) )
40
+ await ipfs . name . publish ( `/ipns/${ nodeId } ` , { 'allow-offline' : true , key : 'key-name-default' } )
41
+
42
+ return expect ( ipfs . name . resolve ( `/ipns/${ keyId } ` ) )
39
43
. to . become ( `/ipfs/${ path } ` )
40
44
} )
41
45
@@ -58,12 +62,16 @@ module.exports = (createCommon, options) => {
58
62
. to . become ( `/ipfs/${ path } ` )
59
63
} )
60
64
61
- // This test should be changed to the recursive logic when recursive === true is the default
62
65
it ( 'should resolve a record default options with remainder' , async ( ) => {
63
- const [ { path } ] = await ipfs . add ( Buffer . from ( 'should resolve a record with the default params with remainder' ) )
66
+ const [ { path } ] = await ipfs . add ( Buffer . from ( 'should resolve a record default options with remainder' ) )
67
+
68
+ const { id : keyId } = await ipfs . key . gen ( 'key-name-remainder-default' , { type : 'rsa' , size : 2048 } )
69
+
64
70
await ipfs . name . publish ( path , { 'allow-offline' : true } )
65
- return expect ( ipfs . name . resolve ( `/ipns/${ nodeId } /remainder/file.txt` ) )
66
- . to . become ( `/ipfs/${ path } /remainder/file.txt` )
71
+ await ipfs . name . publish ( `/ipns/${ nodeId } ` , { 'allow-offline' : true , key : 'key-name-remainder-default' } )
72
+
73
+ return expect ( ipfs . name . resolve ( `/ipns/${ keyId } /remainder/file.txt` ) )
74
+ . to . be . eventually . equal ( `/ipfs/${ path } /remainder/file.txt` )
67
75
} )
68
76
69
77
it ( 'should resolve a record recursive === false with remainder' , async ( ) => {
@@ -122,10 +130,9 @@ module.exports = (createCommon, options) => {
122
130
123
131
after ( ( done ) => common . teardown ( done ) )
124
132
125
- // This test should be changed to the recursive logic when recursive === true is the default
126
133
it ( 'should resolve /ipns/ipfs.io' , async ( ) => {
127
134
return expect ( ipfs . name . resolve ( '/ipns/ipfs.io' ) )
128
- . to . eventually . match ( / \/ i p n s \/ .+ $ / )
135
+ . to . eventually . match ( / \/ i p f s \/ .+ $ / )
129
136
} )
130
137
131
138
it ( 'should resolve /ipns/ipfs.io recursive === false' , async ( ) => {
@@ -138,10 +145,9 @@ module.exports = (createCommon, options) => {
138
145
. to . eventually . match ( / \/ i p f s \/ .+ $ / )
139
146
} )
140
147
141
- // This test should be changed to the recursive logic when recursive === true is the default
142
148
it ( 'should resolve /ipns/ipfs.io with remainder' , async ( ) => {
143
149
return expect ( ipfs . name . resolve ( '/ipns/ipfs.io/images/ipfs-logo.svg' ) )
144
- . to . eventually . match ( / \/ i p n s \/ .+ \/ i m a g e s \/ i p f s - l o g o .s v g $ / )
150
+ . to . eventually . match ( / \/ i p f s \/ .+ \/ i m a g e s \/ i p f s - l o g o .s v g $ / )
145
151
} )
146
152
147
153
it ( 'should resolve /ipns/ipfs.io with remainder recursive === false' , async ( ) => {
0 commit comments