@@ -3,37 +3,37 @@ defmodule DraftTest do
3
3
doctest Draft
4
4
5
5
test "generate a <p>" do
6
- input = ~s ( {"entityMap": {},"blocks":[ {"key": "9d21d","text": "Hello","type": "unstyled","depth": 0,"inlineStyleRanges": [],"entityRanges": [],"data": {}}]})
6
+ input = % { "entityMap" => % { } , "blocks" => [ % { "key" => "9d21d" , "text" => "Hello" , "type" => "unstyled" , "depth" => 0 , "inlineStyleRanges" => [ ] , "entityRanges" => [ ] , "data" => % { } } ] }
7
7
output = "<p>Hello</p>"
8
8
assert Draft . to_html ( input ) == output
9
9
end
10
10
11
11
test "generate a <h1>" do
12
- input = ~s ( {"entityMap": {},"blocks":[ {"key": "9d21d","text": "Hello","type": "header-one","depth": 0,"inlineStyleRanges": [],"entityRanges": [],"data": {}}]})
12
+ input = % { "entityMap" => % { } , "blocks" => [ % { "key" => "9d21d" , "text" => "Hello" , "type" => "header-one" , "depth" => 0 , "inlineStyleRanges" => [ ] , "entityRanges" => [ ] , "data" => % { } } ] }
13
13
output = "<h1>Hello</h1>"
14
14
assert Draft . to_html ( input ) == output
15
15
end
16
16
17
17
test "generate a <h2>" do
18
- input = ~s ( {"entityMap": {},"blocks":[ {"key": "9d21d","text": "Hello","type": "header-two","depth": 0,"inlineStyleRanges": [],"entityRanges": [],"data": {}}]})
18
+ input = % { "entityMap" => % { } , "blocks" => [ % { "key" => "9d21d" , "text" => "Hello" , "type" => "header-two" , "depth" => 0 , "inlineStyleRanges" => [ ] , "entityRanges" => [ ] , "data" => % { } } ] }
19
19
output = "<h2>Hello</h2>"
20
20
assert Draft . to_html ( input ) == output
21
21
end
22
22
23
23
test "generate a <h3>" do
24
- input = ~s ( {"entityMap": {},"blocks":[ {"key": "9d21d","text": "Hello","type": "header-three","depth": 0,"inlineStyleRanges": [],"entityRanges": [],"data": {}}]})
24
+ input = % { "entityMap" => % { } , "blocks" => [ % { "key" => "9d21d" , "text" => "Hello" , "type" => "header-three" , "depth" => 0 , "inlineStyleRanges" => [ ] , "entityRanges" => [ ] , "data" => % { } } ] }
25
25
output = "<h3>Hello</h3>"
26
26
assert Draft . to_html ( input ) == output
27
27
end
28
28
29
29
test "generate a <blockquote>" do
30
- input = ~s ( {"entityMap": {},"blocks":[ {"key": "9d21d","text": "Hello","type": "blockquote","depth": 0,"inlineStyleRanges": [],"entityRanges": [],"data": {}}]})
30
+ input = % { "entityMap" => % { } , "blocks" => [ % { "key" => "9d21d" , "text" => "Hello" , "type" => "blockquote" , "depth" => 0 , "inlineStyleRanges" => [ ] , "entityRanges" => [ ] , "data" => % { } } ] }
31
31
output = "<blockquote>Hello</blockquote>"
32
32
assert Draft . to_html ( input ) == output
33
33
end
34
34
35
35
test "generate a <br>" do
36
- input = ~s ( {"entityMap": {},"blocks":[ {"key": "9d21d","text": "","type": "unstyled","depth": 0,"inlineStyleRanges": [],"entityRanges": [],"data": {}}]})
36
+ input = % { "entityMap" => % { } , "blocks" => [ % { "key" => "9d21d" , "text" => "" , "type" => "unstyled" , "depth" => 0 , "inlineStyleRanges" => [ ] , "entityRanges" => [ ] , "data" => % { } } ] }
37
37
output = "<br>"
38
38
assert Draft . to_html ( input ) == output
39
39
end
0 commit comments