This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
lib/groupher_server_web/middleware
test/groupher_server_web/mutation/accounts Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ defmodule GroupherServerWeb.Middleware.PageSizeProof do
24
24
when not is_nil ( customization ) do
25
25
# NOTE: c11n display_density should also linted by page limit,
26
26
# otherwise dataloader will crash for empty extra items
27
- size = customization . display_density |> String . to_integer ( ) |> min ( @ max_page_size )
27
+ size = customization . display_density |> String . to_integer ( ) |> min ( @ max_page_size - 2 )
28
+ # size = 28
28
29
29
30
case Map . has_key? ( arguments , :filter ) do
30
31
true ->
Original file line number Diff line number Diff line change 1
1
defmodule GroupherServer.Test.Mutation.Account.Customization do
2
2
use GroupherServer.TestTools
3
3
4
+ import Helper.Utils , only: [ get_config: 2 ]
5
+ @ max_page_size get_config ( :general , :page_size )
6
+
4
7
setup do
5
8
{ :ok , user } = db_insert ( :user )
6
9
@@ -84,7 +87,8 @@ defmodule GroupherServer.Test.Mutation.Account.Customization do
84
87
85
88
variables = % { filter: % { page: 1 } }
86
89
results = user_conn |> query_result ( @ paged_post_query , variables , "pagedPosts" )
87
- assert results [ "pageSize" ] == 30
90
+ # FIXME: this 2 is magic number, otherwise it will crash the dataloader
91
+ assert results [ "pageSize" ] == @ max_page_size - 2
88
92
end
89
93
90
94
test "set single customization should merge not overwright other settings" , ~m( user_conn) a do
You can’t perform that action at this time.
0 commit comments