Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkonidas committed Jun 20, 2024
1 parent eedd4f0 commit 7fa336f
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/plexus/pagination_helpers_test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
defmodule Plexus.PaginationHelpersTest do
use ExUnit.Case, async: true
doctest Plexus.PaginationHelpers

alias Plexus.PaginationHelpers

describe "page_opts/1" do
test "with page and page_size" do
assert [page: 9, page_size: 30] = PaginationHelpers.page_opts(%{page_size: 30, page: 9})
end

test "with limit" do
assert [page_size: 30] = PaginationHelpers.page_opts(%{limit: 30})
end

test "with page only" do
assert [page: 3] = PaginationHelpers.page_opts(%{page: 3})
end

test "with empty map" do
assert [] = PaginationHelpers.page_opts(%{})
end

test "with non supported key/values" do
assert [] = PaginationHelpers.page_opts(%{bogus: :value})
end
end
end

0 comments on commit 7fa336f

Please sign in to comment.