Skip to content

Commit b2bd5f2

Browse files
authored
fix: linkify tests (#1064)
* replace ipfs.git.sexy with wiki-on-ipfs * chore: typo fix
1 parent 9ebfbba commit b2bd5f2

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See the [GitHub Flow Guide](https://guides.github.com/introduction/flow/) for de
2828

2929
Go to Transifex and join [IPFS Companion Translation Project](https://www.transifex.com/ipfs/ipfs-companion/) :sparkles:
3030

31-
If you want to downoad translations from Transifex and run them locally, make sure to read [Localization Notes](LOCALIZATION-NOTES.md) first.
31+
If you want to download translations from Transifex and run them locally, make sure to read [Localization Notes](LOCALIZATION-NOTES.md) first.
3232

3333
## Writing Code
3434

test/data/linkify-demo.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ <h1> Should be linkified</h1>
1414
<br>/ipfs/bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy
1515
<br>ipfs://QmTAsnXoWmLZQEpvyZscrReFzqxP3pvULfGVgpJuayrp1w (cidv0b58)
1616
<br>ipfs://bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy (cidv1b32)
17-
<br>ipns://ipfs.git.sexy
17+
<br>ipns://en.wikipedia-on-ipfs.org
1818
<br>dweb:/ipfs/QmTAsnXoWmLZQEpvyZscrReFzqxP3pvULfGVgpJuayrp1w
1919
<h1> Should NOT be linkified</h1>
2020
<br>ipfs:/QmTAsnXoWmLZQEpvyZscrReFzqxP3pvULfGVgpJuayrp1w
21-
<br>ipns:/ipfs.git.sexy
21+
<br>ipns:/en.wikipedia-on-ipfs.org
2222
<br>dweb://ipfs/QmTAsnXoWmLZQEpvyZscrReFzqxP3pvULfGVgpJuayrp1w
2323
<br>
2424
</p>

test/functional/lib/dnslink.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ describe('dnslinkResolver', function () {
4444

4545
describe('convertToIpnsPath(url)', function () {
4646
it('should return IPNS path', function () {
47-
const url = new URL('http://ipfs.git.sexy/sketches/ipld_intro.html?a=b#c=d')
47+
const url = new URL('http://en.wikipedia-on-ipfs.org/sketches/ipld_intro.html?a=b#c=d')
4848
const dnslinkResolver = createDnslinkResolver(getExternalNodeState)
4949
expect(dnslinkResolver.convertToIpnsPath(url))
50-
.to.equal('/ipns/ipfs.git.sexy/sketches/ipld_intro.html?a=b#c=d')
50+
.to.equal('/ipns/en.wikipedia-on-ipfs.org/sketches/ipld_intro.html?a=b#c=d')
5151
})
5252
})
5353
})

test/functional/lib/ipfs-request-gateway-redirect.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ describe('modifyRequest.onBeforeRequest:', function () {
209209
state.ipfsNodeType = 'external'
210210
})
211211
it('should be served from custom gateway if {path} points to a FQDN with existing dnslink', function () {
212-
const request = url2request('https://google.com/ipns/ipfs.git.sexy/index.html?argTest#hashTest')
212+
const request = url2request('https://google.com/ipns/en.wikipedia-on-ipfs.org/index.html?argTest#hashTest')
213213
// stub the existence of valid dnslink
214-
const fqdn = 'ipfs.git.sexy'
214+
const fqdn = 'en.wikipedia-on-ipfs.org'
215215
dnslinkResolver.readDnslinkFromTxtRecord = sinon.stub().withArgs(fqdn).returns('/ipfs/Qmazvovg6Sic3m9igZMKoAPjkiVZsvbWWc8ZvgjjK1qMss')
216216
// pretend API is online and we can do dns lookups with it
217217
state.peerCount = 1
218-
expect(modifyRequest.onBeforeRequest(request).redirectUrl).to.equal('http://localhost:8080/ipns/ipfs.git.sexy/index.html?argTest#hashTest')
218+
expect(modifyRequest.onBeforeRequest(request).redirectUrl).to.equal('http://localhost:8080/ipns/en.wikipedia-on-ipfs.org/index.html?argTest#hashTest')
219219
})
220220
it('should be served from custom gateway if {path} starts with a valid PeerID', function () {
221221
const request = url2request('https://google.com/ipns/QmSWnBwMKZ28tcgMFdihD8XS7p6QzdRSGf71cCybaETSsU/index.html?argTest#hashTest')
@@ -229,13 +229,13 @@ describe('modifyRequest.onBeforeRequest:', function () {
229229
state.ipfsNodeType = 'embedded'
230230
})
231231
it('should be served from public gateway if {path} points to a FQDN with existing dnslink', function () {
232-
const request = url2request('https://google.com/ipns/ipfs.git.sexy/index.html?argTest#hashTest')
232+
const request = url2request('https://google.com/ipns/en.wikipedia-on-ipfs.org/index.html?argTest#hashTest')
233233
// stub the existence of valid dnslink
234-
const fqdn = 'ipfs.git.sexy'
234+
const fqdn = 'en.wikipedia-on-ipfs.org'
235235
dnslinkResolver.readDnslinkFromTxtRecord = sinon.stub().withArgs(fqdn).returns('/ipfs/Qmazvovg6Sic3m9igZMKoAPjkiVZsvbWWc8ZvgjjK1qMss')
236236
// pretend API is online and we can do dns lookups with it
237237
state.peerCount = 1
238-
expect(modifyRequest.onBeforeRequest(request).redirectUrl).to.equal('https://ipfs.io/ipns/ipfs.git.sexy/index.html?argTest#hashTest')
238+
expect(modifyRequest.onBeforeRequest(request).redirectUrl).to.equal('https://ipfs.io/ipns/en.wikipedia-on-ipfs.org/index.html?argTest#hashTest')
239239
})
240240
it('should be served from public gateway if {path} starts with a valid PeerID', function () {
241241
const request = url2request('https://google.com/ipns/QmSWnBwMKZ28tcgMFdihD8XS7p6QzdRSGf71cCybaETSsU/index.html?argTest#hashTest')

0 commit comments

Comments
 (0)