Skip to content

Commit

Permalink
test(tags): enable with query params tests cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Oct 20, 2024
1 parent 901663d commit 433405a
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ class TagRouteV1Spec extends AnyWordSpec with BeforeAndAfterAll {
.unsafeRunSync()
}

/*
TODO: Why do these tests are returns 404?
"return specific tag contents with query params" in {
client
// .run(Request(method = Method.GET, uri = new Uri().withPath(s"/tags/${t(1).name.value}?page=1&limit=10")))
.run(Request(method = Method.GET, uri = host.withPath("/tags/tagRoute-0?page=1&limit=10")))
.run(
Request(
method = Method.GET,
uri = new Uri().withPath(Uri.Path.unsafeFromString(s"/v1/tags/${t(0).name.value}")).withQueryParam("page", "1").withQueryParam("limit", "10")
)
)
.use { response =>
IO {
assert(response.status === Ok)
Expand All @@ -117,18 +119,21 @@ class TagRouteV1Spec extends AnyWordSpec with BeforeAndAfterAll {

"return 10 specific tag contents with query params" in {
client
// .run(Request(method = Method.GET, uri = new Uri().withPath(s"/tags/${t(0).name.value}?page=1&limit=50")))
.run(Request(method = Method.GET, uri = host.withPath(s"/tags/tagRoute-0?page=1&limit=50")))
.run(
Request(
method = Method.GET,
uri = new Uri().withPath(Uri.Path.unsafeFromString(s"/v1/tags/${t(1).name.value}")).withQueryParam("page", "1").withQueryParam("limit", "50")
)
)
.use { response =>
IO {
assert(response.status === Ok)
assert(response.contentType.get === `Content-Type`(MediaType.application.json))
assert(response.as[String].unsafeRunSync().replaceAll("\n", "").replaceAll(" ", "").contains("/test/tagRoute-0"))
assert(response.as[String].unsafeRunSync().replaceAll("\n", "").replaceAll(" ", "").contains("/test/tagRoute-1"))
}
}
.unsafeRunSync()
}
*/

"return 404" in {
client
Expand Down

0 comments on commit 433405a

Please sign in to comment.