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.

Commit76f9b89

Browse files
author
mydearxym
committed
chore: wip
1 parent675b1d8 commit76f9b89

File tree

5 files changed

+60
-3
lines changed

5 files changed

+60
-3
lines changed

‎lib/helper/rich_text_parser.ex‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ defmodule Helper.RichTextParser do
44
55
see https://editorjs.io/
66
"""
7+
8+
9+
defstring_to_json(string)do
10+
Jason.decode!(string)
11+
end
712
end

‎test/groupher_server_web/mutation/cms/cms_manager_test.exs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ defmodule GroupherServer.Test.Mutation.CMS.Manager do
2828
}
2929
}
3030
"""
31-
@tag:wip2
3231
test"root can trash a post",~m(community user)ado
3332
post_attrs=mock_attrs(:post,%{community_id:community.id})
3433
{:ok,post}=CMS.create_content(community,:post,post_attrs,user)

‎test/groupher_server_web/mutation/cms/post_test.exs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ defmodule GroupherServer.Test.Mutation.Post do
4646
}
4747
}
4848
"""
49-
@tag:wip
5049
test"create post with valid attrs and make sure author exsit"do
5150
{:ok,user}=db_insert(:user)
5251
user_conn=simu_conn(:user,user)

‎test/groupher_server_web/query/accounts/published_contents_test.exs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ defmodule GroupherServer.Test.Query.Accounts.PublishedContents do
110110
}
111111
}
112112
"""
113-
@tag:wip
114113
test"user can get paged published videos",~m(guest_conn user community)ado
115114
pub_videos=
116115
Enum.reduce(1..@publish_count,[],fn_,acc->
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
defmoduleGroupherServer.Test.Helper.RichTextParserTestdo
2+
@moduledocfalse
3+
4+
useGroupherServerWeb.ConnCase,async:true
5+
6+
aliasHelper.RichTextParser,as:Parser
7+
8+
describe"[basic convert]"do
9+
@tag:wip2
10+
test"string_to_json should work"do
11+
string=~s({"time":1566184478687,"blocks":[{}],"version":"2.15.0"})
12+
hello=Parser.string_to_json(string)
13+
14+
IO.inspect(hello,label:"hello")
15+
end
16+
17+
test"TODO: test emoji. 😏"do
18+
true
19+
end
20+
21+
@tag:wip
22+
test"real data should work"do
23+
editor_json2=~S({
24+
"time": 1563816717958,
25+
"blocks": [{
26+
"type": "header",
27+
"data": {
28+
"text": "(Editor.js\)",
29+
"level": 2
30+
}
31+
}
32+
],
33+
"version": "2.15.0"
34+
})
35+
36+
editor_json="""
37+
{
38+
"time": 1563816717958,
39+
"blocks": [{
40+
"type": "header",
41+
"data": {
42+
"text": "(Editor.js)",
43+
"level": 2
44+
}
45+
}
46+
],
47+
"version": "2.15.0"
48+
}
49+
"""
50+
51+
hello=Jason.decode!(editor_json)
52+
IO.inspect(hello,label:"hello")
53+
end
54+
end
55+
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp