Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit e01dc95

Browse files
committed
chore: Merge branch 'dev'
2 parents 4ba6feb + 7ddd45c commit e01dc95

File tree

10 files changed

+17
-30
lines changed

10 files changed

+17
-30
lines changed

config/mock.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ config :groupher_server, GroupherServer.Repo,
1616
adapter: Ecto.Adapters.Postgres,
1717
username: "postgres",
1818
password: "postgres",
19-
database: "mastani_server_mock",
19+
database: "groupher_server_mock",
2020
hostname: "localhost",
2121
pool_size: 10

lib/groupher_server_web/middleware/pagesize_proof.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ defmodule GroupherServerWeb.Middleware.PageSizeProof do
2323
)
2424
when not is_nil(customization) do
2525
size = String.to_integer(customization.display_density)
26+
size = if size > @max_page_size, do: @max_page_size, else: size
2627

2728
case Map.has_key?(arguments, :filter) do
2829
true ->

lib/groupher_server_web/schema/cms/mutations/post.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule GroupherServerWeb.Schema.CMS.Mutations.Post do
55
use Helper.GqlSchemaSuite
66

77
object :cms_post_mutations do
8-
@desc "create a user"
8+
@desc "create a post"
99
field :create_post, :post do
1010
arg(:title, non_null(:string))
1111
arg(:body, non_null(:string))

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ defmodule GroupherServer.Mixfile do
5757
{:ecto_sql, "~> 3.1.2"},
5858
{:phoenix_ecto, "~> 4.0"},
5959
{:postgrex, ">= 0.14.1"},
60-
{:gettext, "~> 0.16.1"},
60+
{:gettext, "~> 0.17.0"},
6161
{:plug_cowboy, "~> 2.0"},
6262
{:plug, "~> 1.8.0"},
6363
# GraphQl tool

mix.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"credo": {:hex, :credo, "1.0.5", "fdea745579f8845315fe6a3b43e2f9f8866839cfbc8562bb72778e9fdaa94214", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
1818
"dataloader": {:hex, :dataloader, "1.0.6", "fb724d6d3fb6acb87d27e3b32dea3a307936ad2d245faf9cf5221d1323d6a4ba", [:mix], [{:ecto, ">= 0.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"},
1919
"db_connection": {:hex, :db_connection, "2.1.0", "122e2f62c4906bf2e49554f1e64db5030c19229aa40935f33088e7d543aa79d0", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
20-
"decimal": {:hex, :decimal, "1.7.0", "30d6b52c88541f9a66637359ddf85016df9eb266170d53105f02e4a67e00c5aa", [:mix], [], "hexpm"},
20+
"decimal": {:hex, :decimal, "1.8.0", "ca462e0d885f09a1c5a342dbd7c1dcf27ea63548c65a65e67334f4b61803822e", [:mix], [], "hexpm"},
2121
"dialyxir": {:hex, :dialyxir, "1.0.0-rc.6", "78e97d9c0ff1b5521dd68041193891aebebce52fc3b93463c0a6806874557d7d", [:mix], [{:erlex, "~> 0.2.1", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"},
2222
"ecto": {:hex, :ecto, "3.1.5", "07dfe89630857ea1a90fd5575c41b974696dae27071ac91bcbb7b769a15b66db", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
2323
"ecto_sql": {:hex, :ecto_sql, "3.1.5", "b5201fe99fa6bf6a93f64adb2d4976ded3d201f932b7c5bd4c44468642f4fb1f", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:myxql, "~> 0.2.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0 or ~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"},
@@ -28,7 +28,7 @@
2828
"faker": {:hex, :faker, "0.10.0", "367c2ae47e7b4ac6410e1eaa880c07b5fe4194476f697d37ac1ce25f3058aae2", [:mix], [], "hexpm"},
2929
"file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"},
3030
"fs": {:hex, :fs, "0.9.2", "ed17036c26c3f70ac49781ed9220a50c36775c6ca2cf8182d123b6566e49ec59", [:rebar], [], "hexpm"},
31-
"gettext": {:hex, :gettext, "0.16.1", "e2130b25eebcbe02bb343b119a07ae2c7e28bd4b146c4a154da2ffb2b3507af2", [:mix], [], "hexpm"},
31+
"gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"},
3232
"guardian": {:hex, :guardian, "1.2.1", "bdc8dd3dbf0fb7216cb6f91c11831faa1a64d39cdaed9a611e37f2413e584983", [:mix], [{:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.3", [hex: :phoenix, repo: "hexpm", optional: true]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"},
3333
"hackney": {:hex, :hackney, "1.15.1", "9f8f471c844b8ce395f7b6d8398139e26ddca9ebc171a8b91342ee15a19963f4", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
3434
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},

test/groupher_server_web/mutation/accounts/customization_test.exs

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,43 +64,33 @@ defmodule GroupherServer.Test.Mutation.Account.Customization do
6464
@paged_post_query """
6565
query($filter: PagedArticleFilter!) {
6666
pagedPosts(filter: $filter) {
67+
entries {
68+
commentsCount
69+
commentsParticipators(filter: { first: 5 }) {
70+
id
71+
}
72+
}
6773
pageSize
6874
pageNumber
6975
}
7076
}
7177
"""
72-
test "PageSizeProof middleware should load items based on c11n settings", ~m(user)a do
78+
@tag :wip
79+
test "PageSizeProof middleware should lint c11n displayDensity size", ~m(user)a do
7380
user_conn = simu_conn(:user, user)
7481
db_insert_multi(:post, 50)
7582

76-
variables = %{filter: %{page: 1}}
77-
results = user_conn |> query_result(@paged_post_query, variables, "pagedPosts")
78-
assert results["pageSize"] == @max_page_size
79-
8083
variables = %{
8184
customization: %{
82-
displayDensity: "25"
85+
displayDensity: "40"
8386
}
8487
}
8588

86-
user_conn |> mutation_result(@query, variables, "setCustomization")
89+
hello = user_conn |> mutation_result(@query, variables, "setCustomization")
8790

8891
variables = %{filter: %{page: 1}}
8992
results = user_conn |> query_result(@paged_post_query, variables, "pagedPosts")
90-
assert results["pageSize"] == 25
91-
92-
variables = %{
93-
customization: %{
94-
displayDensity: "20"
95-
}
96-
}
97-
98-
user_conn |> mutation_result(@query, variables, "setCustomization")
99-
100-
variables = %{filter: %{page: 2}}
101-
results = user_conn |> query_result(@paged_post_query, variables, "pagedPosts")
102-
assert results["pageSize"] == 20
103-
assert results["pageNumber"] == 2
93+
assert results["pageSize"] == 30
10494
end
10595

10696
test "set single customization should merge not overwright other settings", ~m(user_conn)a do

test/groupher_server_web/mutation/cms/job_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ defmodule GroupherServer.Test.Mutation.Job do
9292
assert created["id"] == to_string(found.id)
9393
end
9494

95-
@tag :wip
9695
test "create job should excape xss attracts" do
9796
{:ok, user} = db_insert(:user)
9897
user_conn = simu_conn(:user, user)

test/groupher_server_web/mutation/cms/post_comment_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ defmodule GroupherServer.Test.Mutation.PostComment do
4848
assert created["id"] == to_string(found.id)
4949
end
5050

51-
@tag :wip
5251
test "xss comment should be escaped", ~m(user_conn community post)a do
5352
variables = %{
5453
community: community.raw,

test/groupher_server_web/mutation/cms/post_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ defmodule GroupherServer.Test.Mutation.Post do
6363
assert {:ok, _} = ORM.find_by(CMS.Author, user_id: user.id)
6464
end
6565

66-
@tag :wip
6766
test "create post should excape xss attracts" do
6867
{:ok, user} = db_insert(:user)
6968
user_conn = simu_conn(:user, user)

test/groupher_server_web/mutation/cms/repo_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ defmodule GroupherServer.Test.Mutation.Repo do
154154
assert updated["readme"] == "new readme"
155155
end
156156

157-
@tag :wip
158157
test "create repo should excape xss attracts" do
159158
{:ok, user} = db_insert(:user)
160159
user_conn = simu_conn(:user, user)

0 commit comments

Comments
 (0)