Skip to content

Commit

Permalink
fix: remove range test for dag-cbor as text/html (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias authored Apr 11, 2024
1 parent a95b2db commit a1ce2b8
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions tests/path_gateway_dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,6 @@ func TestNativeDag(t *testing.T) {
RunWithSpecs(t, rangeTests, specs.PathGatewayDAG)
}

var dagCborHTMLRendering []byte
RunWithSpecs(t, SugarTests{
SugarTest{
Name: "Convert application/vnd.ipld.dag-cbor to text/html",
Expand All @@ -704,34 +703,9 @@ func TestNativeDag(t *testing.T) {
Headers(
Header("Accept", "text/html"),
),
Response: Expect().Body(Checks("", func(t []byte) bool {
innerCheck := Contains("</html>").Check(string(t))
if innerCheck.Success {
dagCborHTMLRendering = t
return true
}
return false
})),
Response: Expect().Body(Contains("</html>")),
},
}, specs.PathGatewayDAG)

if dagCborHTMLRendering != nil {
rangeTests := helpers.OnlyRandomRangeTests(t,
SugarTest{
Name: "Convert application/vnd.ipld.dag-cbor to text/html with range request includes correct bytes",
Hint: "",
Request: Request().
Path("/ipfs/{{cid}}/", dagCborCID).
Headers(
Header("Accept", "text/html"),
),
Response: Expect(),
},
dagCborHTMLRendering,
"text/html")

RunWithSpecs(t, rangeTests, specs.PathGatewayDAG)
}
}

func TestGatewayJSONCborAndIPNS(t *testing.T) {
Expand Down

0 comments on commit a1ce2b8

Please sign in to comment.