Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Jan 2, 2025
1 parent 9edb7a4 commit f71abb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gateway/handler_unixfs_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
// https://github.com/ipfs/dir-index-html/issues/42
require.Contains(t, s, "<a class=\"ipfs-hash\" translate=\"no\" href=\"https://cid.ipfs.tech/#", "expected links to cid.ipfs.tech in CID column when on DNSLink website")
require.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/..\">", "expected backlink in directory listing")
require.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/file.txt\">", "expected file in directory listing")
require.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/file.txt/\">", "expected file in directory listing")
require.Contains(t, s, s, k2.RootCid().String(), "expected hash in directory listing")

// make request to directory listing at root
Expand All @@ -65,7 +65,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {

require.True(t, matchPathOrBreadcrumbs(s, "/"), "expected a path in directory listing")
require.NotContains(t, s, "<a href=\"/\">", "expected no backlink in directory listing of the root CID")
require.Contains(t, s, "<a href=\"/file.txt\">", "expected file in directory listing")
require.Contains(t, s, "<a href=\"/file.txt/\">", "expected file in directory listing")
// https://github.com/ipfs/dir-index-html/issues/42
require.Contains(t, s, "<a class=\"ipfs-hash\" translate=\"no\" href=\"https://cid.ipfs.tech/#", "expected links to cid.ipfs.tech in CID column when on DNSLink website")
require.Contains(t, s, root.String(), "expected hash in directory listing")
Expand All @@ -85,6 +85,6 @@ func TestIPNSHostnameBacklinks(t *testing.T) {

require.True(t, matchPathOrBreadcrumbs(s, "/ipns/<a href=\"//example.net/\">example.net</a>/<a href=\"//example.net/foo%3F%20%23%3C%27\">foo? #&lt;&#39;</a>/<a href=\"//example.net/foo%3F%20%23%3C%27/bar\">bar</a>"), "expected a path in directory listing")
require.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/bar/..\">", "expected backlink in directory listing")
require.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/bar/file.txt\">", "expected file in directory listing")
require.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/bar/file.txt/\">", "expected file in directory listing")
require.Contains(t, s, k3.RootCid().String(), "expected hash in directory listing")
}

0 comments on commit f71abb0

Please sign in to comment.