@@ -3,37 +3,37 @@ defmodule DraftTest do
33 doctest Draft
44
55 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" => % { } } ] }
77 output = "<p>Hello</p>"
88 assert Draft . to_html ( input ) == output
99 end
1010
1111 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" => % { } } ] }
1313 output = "<h1>Hello</h1>"
1414 assert Draft . to_html ( input ) == output
1515 end
1616
1717 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" => % { } } ] }
1919 output = "<h2>Hello</h2>"
2020 assert Draft . to_html ( input ) == output
2121 end
2222
2323 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" => % { } } ] }
2525 output = "<h3>Hello</h3>"
2626 assert Draft . to_html ( input ) == output
2727 end
2828
2929 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" => % { } } ] }
3131 output = "<blockquote>Hello</blockquote>"
3232 assert Draft . to_html ( input ) == output
3333 end
3434
3535 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" => % { } } ] }
3737 output = "<br>"
3838 assert Draft . to_html ( input ) == output
3939 end
0 commit comments