Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit7905eac

Browse files
committed
fix(c11n): pagesize proof middleware lint
and clean up wip tags
1 parent798a6c3 commit7905eac

File tree

9 files changed

+15
-28
lines changed

9 files changed

+15
-28
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
whennotis_nil(customization)do
2525
size=String.to_integer(customization.display_density)
26+
size=ifsize>@max_page_size,do:@max_page_size,else:size
2627

2728
caseMap.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
useHelper.GqlSchemaSuite
66

77
object:cms_post_mutationsdo
8-
@desc"create auser"
8+
@desc"create apost"
99
field:create_post,:postdo
1010
arg(:title,non_null(:string))
1111
arg(:body,non_null(:string))

‎mix.lock‎

Lines changed: 1 addition & 1 deletion
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"},

‎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)ado
78+
@tag:wip
79+
test"PageSizeProof middleware should lint c11n displayDensity size",~m(user)ado
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-
assertresults["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-
assertresults["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-
assertresults["pageSize"]==20
103-
assertresults["pageNumber"]==2
93+
assertresults["pageSize"]==30
10494
end
10595

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

‎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
assertcreated["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
assertcreated["id"]==to_string(found.id)
4949
end
5050

51-
@tag:wip
5251
test"xss comment should be escaped",~m(user_conn community post)ado
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
assertupdated["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)

[8]ページ先頭

©2009-2025 Movatter.jp